Radio - 图1

Radio Svelte Component

Radio Svelte component represents Radio component.

Radio Components

There are following components included:

  • Radio

Radio Properties

PropTypeDefaultDescription
<Radio> properties
checkedbooleanDefines whether the radio input is checked or not
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" />
  4. <ListItem radio value="check_2" name="demo-radio" title="Radio 2" />
  5. </List>

Examples

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

← Progressbar

Range Slider →