Checkbox - 图1

Checkbox React Component

Checkbox React component represents Checkbox component.

Checkbox Components

There are following components included:

  • **Checkbox** / **F7Checkbox**

Checkbox Properties

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

Checkbox Events

EventDescription
<Checkbox> events
changeEvent will be triggered when checkbox state changed

Checkboxes List

Checkboxes List is not a separate component, but just a particular case of using [<List>]($494f424e3ec76a4c.md), [<ListItem>]($5dc8f04c362ea253.md).

  1. <List>
  2. <!-- Additional "checkbox" prop to enable checkbox list item -->
  3. <ListItem checkbox value="check_1" checked title="Checkbox 1"></ListItem>
  4. <ListItem checkbox value="check_2" title="Checkbox 2"></ListItem>
  5. </List>

Examples

  1. <BlockTitle>Inline</BlockTitle>
  2. <Block strong>
  3. <p>Lorem <Checkbox name="checkbox-1"></Checkbox> ipsum dolor sit amet, consectetur adipisicing elit. Alias beatae illo nihil aut eius commodi sint eveniet aliquid eligendi <Checkbox name="checkbox-2" defaultChecked></Checkbox> ad delectus impedit tempore nemo, enim vel praesentium consequatur nulla mollitia!</p>
  4. </Block>
  5. <BlockTitle>Checkbox Group</BlockTitle>
  6. <List>
  7. <ListItem checkbox title="Books" name="demo-checkbox" defaultChecked></ListItem>
  8. <ListItem checkbox title="Movies" name="demo-checkbox"></ListItem>
  9. <ListItem checkbox title="Food" name="demo-checkbox"></ListItem>
  10. <ListItem checkbox title="Drinks" name="demo-checkbox"></ListItem>
  11. </List>
  12. <BlockTitle>With Media Lists</BlockTitle>
  13. <List mediaList>
  14. <ListItem
  15. checkbox
  16. defaultChecked
  17. name="demo-media-checkbox"
  18. title="Facebook"
  19. after="17:14"
  20. subtitle="New messages from John Doe"
  21. 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."
  22. ></ListItem>
  23. <ListItem
  24. checkbox
  25. name="demo-media-checkbox"
  26. title="John Doe (via Twitter)"
  27. after="17:11"
  28. subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
  29. 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."
  30. ></ListItem>
  31. <ListItem
  32. checkbox
  33. name="demo-media-checkbox"
  34. title="Facebook"
  35. after="16:48"
  36. subtitle="New messages from John Doe"
  37. 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."
  38. ></ListItem>
  39. <ListItem
  40. checkbox
  41. name="demo-media-checkbox"
  42. title="John Doe (via Twitter)"
  43. after="15:32"
  44. subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
  45. 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."
  46. ></ListItem>