Radio - 图1

Radio React Component

Radio React component represents Radio component.

Radio Components

There are following components included:

  • **Radio** / **F7Radio**

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>]($7b374ae2a08124d4.md), [<ListItem>]($0b7121fee8bea8f7.md).

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

Examples

  1. <BlockTitle>Inline</BlockTitle>
  2. <Block strong>
  3. <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>
  4. </Block>
  5. <BlockTitle>Radio Group</BlockTitle>
  6. <List>
  7. <ListItem radio title="Books" name="demo-radio" value="Books" defaultChecked></ListItem>
  8. <ListItem radio title="Movies" value="Movies" name="demo-radio"></ListItem>
  9. <ListItem radio title="Food" value="Food" name="demo-radio"></ListItem>
  10. <ListItem radio title="Drinks" value="Drinks" name="demo-radio"></ListItem>
  11. </List>
  12. <BlockTitle>With Media Lists</BlockTitle>
  13. <List mediaList>
  14. <ListItem
  15. radio
  16. defaultChecked
  17. name="demo-media-radio"
  18. value="1"
  19. title="Facebook"
  20. after="17:14"
  21. subtitle="New messages from John Doe"
  22. 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."
  23. ></ListItem>
  24. <ListItem
  25. radio
  26. name="demo-media-radio"
  27. value="2"
  28. title="John Doe (via Twitter)"
  29. after="17:11"
  30. subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
  31. 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."
  32. ></ListItem>
  33. <ListItem
  34. radio
  35. name="demo-media-radio"
  36. value="3"
  37. title="Facebook"
  38. after="16:48"
  39. subtitle="New messages from John Doe"
  40. 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."
  41. ></ListItem>
  42. <ListItem
  43. radio
  44. name="demo-media-radio"
  45. value="4"
  46. title="John Doe (via Twitter)"
  47. after="15:32"
  48. subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
  49. 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."
  50. ></ListItem>
  51. </List>