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>, <ListItem>.

  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. <BlockHeader>Icon in the beginning of the list item</BlockHeader>
  7. <List>
  8. <ListItem
  9. radio
  10. radioIcon="start"
  11. title="Books"
  12. value="Books"
  13. name="demo-radio-start"
  14. defaultChecked
  15. ></ListItem>
  16. <ListItem
  17. radio
  18. radioIcon="start"
  19. title="Movies"
  20. value="Movies"
  21. name="demo-radio-start"
  22. ></ListItem>
  23. <ListItem
  24. radio
  25. radioIcon="start"
  26. title="Food"
  27. value="Food"
  28. name="demo-radio-start"
  29. ></ListItem>
  30. <ListItem
  31. radio
  32. radioIcon="start"
  33. title="Drinks"
  34. value="Drinks"
  35. name="demo-radio-start"
  36. ></ListItem>
  37. </List>
  38. <BlockHeader>Icon in the end of the list item</BlockHeader>
  39. <List>
  40. <ListItem
  41. radio
  42. radioIcon="end"
  43. title="Books"
  44. value="Books"
  45. name="demo-radio-end"
  46. defaultChecked
  47. ></ListItem>
  48. <ListItem
  49. radio
  50. radioIcon="end"
  51. title="Movies"
  52. value="Movies"
  53. name="demo-radio-end"
  54. ></ListItem>
  55. <ListItem
  56. radio
  57. radioIcon="end"
  58. title="Food"
  59. value="Food"
  60. name="demo-radio-end"
  61. ></ListItem>
  62. <ListItem
  63. radio
  64. radioIcon="end"
  65. title="Drinks"
  66. value="Drinks"
  67. name="demo-radio-end"
  68. ></ListItem>
  69. </List>
  70. <BlockTitle>With Media Lists</BlockTitle>
  71. <List mediaList>
  72. <ListItem
  73. radio
  74. defaultChecked
  75. name="demo-media-radio"
  76. value="1"
  77. title="Facebook"
  78. after="17:14"
  79. subtitle="New messages from John Doe"
  80. 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."
  81. ></ListItem>
  82. <ListItem
  83. radio
  84. name="demo-media-radio"
  85. value="2"
  86. title="John Doe (via Twitter)"
  87. after="17:11"
  88. subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
  89. 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."
  90. ></ListItem>
  91. <ListItem
  92. radio
  93. name="demo-media-radio"
  94. value="3"
  95. title="Facebook"
  96. after="16:48"
  97. subtitle="New messages from John Doe"
  98. 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."
  99. ></ListItem>
  100. <ListItem
  101. radio
  102. name="demo-media-radio"
  103. value="4"
  104. title="John Doe (via Twitter)"
  105. after="15:32"
  106. subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
  107. 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."
  108. ></ListItem>
  109. </List>

← Progressbar

Range Slider →