Radio React Component

Radio React component represents Radio component.

Radio Components

There are following components included:

Radio Properties

PropTypeDefaultDescription
<Radio> properties
checkedbooleanDefines whether the radio input is checked or not
defaultCheckedbooleanDefines whether the checkbox input is checked or not, for the case if it is uncontrolled component
namestring
number
Radio input name
valuestring
number
boolean
Radio input value
disabledbooleanDefines whether the radio input is disabled
readonlybooleanDefines whether the radio input is readonly

Radio Events

EventDescription
<Radio> events
changeEvent will be triggered when radio input state changed

Radios List

Radios List is not a separate component, but just a particular case of using <List>, <ListItem>.

<List>
  {/* Additional "radio" prop to enable radio list item */}
  <ListItem radio value="check_1" name="demo-radio" checked title="Radio 1"></ListItem>
  <ListItem radio value="check_2" name="demo-radio" title="Radio 2"></ListItem>
</List>

Examples

radio.jsx
import React from 'react';
import { Navbar, Page, BlockTitle, Block, List, ListItem, Radio } from 'framework7-react';

export default () => (
  <Page>
    <Navbar title="Radio"></Navbar>

    <BlockTitle>Inline</BlockTitle>
    <Block strongIos outlineIos>
      <p>
        Lorem <Radio name="demo-radio-inline" value="inline-1" /> ipsum dolor sit amet, consectetur
        adipisicing elit. Alias beatae illo nihil aut eius commodi sint eveniet aliquid eligendi{' '}
        <Radio name="demo-radio-inline" value="inline-2" defaultChecked /> ad delectus impedit
        tempore nemo, enim vel praesentium consequatur nulla mollitia!
      </p>
    </Block>

    <BlockTitle>Radio Group</BlockTitle>
    <List strongIos outlineIos dividersIos>
      <ListItem
        radio
        radioIcon="start"
        title="Books"
        name="demo-radio-start"
        value="Books"
        defaultChecked
      />
      <ListItem radio radioIcon="start" title="Movies" value="Movies" name="demo-radio-start" />
      <ListItem radio radioIcon="start" title="Food" value="Food" name="demo-radio-start" />
      <ListItem radio radioIcon="start" title="Drinks" value="Drinks" name="demo-radio-start" />
    </List>

    <List strongIos outlineIos dividersIos>
      <ListItem
        radio
        radioIcon="end"
        title="Books"
        name="demo-radio-end"
        value="Books"
        defaultChecked
      />
      <ListItem radio radioIcon="end" title="Movies" value="Movies" name="demo-radio-end" />
      <ListItem radio radioIcon="end" title="Food" value="Food" name="demo-radio-end" />
      <ListItem radio radioIcon="end" title="Drinks" value="Drinks" name="demo-radio-end" />
    </List>

    <BlockTitle>With Media Lists</BlockTitle>
    <List strongIos outlineIos dividersIos mediaList>
      <ListItem
        radio
        radioIcon="start"
        defaultChecked
        name="demo-media-radio"
        value="1"
        title="Facebook"
        after="17:14"
        subtitle="New messages from John Doe"
        text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
      />
      <ListItem
        radio
        radioIcon="start"
        name="demo-media-radio"
        value="2"
        title="John Doe (via Twitter)"
        after="17:11"
        subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
        text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
      />
      <ListItem
        radio
        radioIcon="start"
        name="demo-media-radio"
        value="3"
        title="Facebook"
        after="16:48"
        subtitle="New messages from John Doe"
        text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
      />
      <ListItem
        radio
        radioIcon="start"
        name="demo-media-radio"
        value="4"
        title="John Doe (via Twitter)"
        after="15:32"
        subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
        text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
      />
    </List>
  </Page>
);