Toggle - 图1

Toggle React Component

Toggle React component represents Toggle component.

Toggle Components

There are following components included:

  • Toggle / F7Toggle

Toggle Properties

PropTypeDefaultDescription
<Toggle> properties
initbooleantrueInitializes Toggle
namestringToggle input name
valuestring
number
Toggle input value
checkedbooleanfalseDefines whether the toggle input is checked or not
disabledbooleanfalseDefines whether the toggle input is disabled or not
readonlybooleanfalseDefines whether the toggle input is readonly or not

Toggle Events

EventDescription
<Toggle> events
changeEvent will be triggered when toggle checkbox state changed. This event may not occur on touch devices, so it is better to use next toggle:change event instead
toggleChangeEvent will be triggered when toggle checkbox state changed

Toggle Methods

EventDescription
<Toggle> methods
.toggle()Toggle checkbox state

Examples

  1. <BlockTitle>Super Heroes</BlockTitle>
  2. <List simpleList>
  3. <ListItem>
  4. <span>Batman</span>
  5. <Toggle defaultChecked />
  6. </ListItem>
  7. <ListItem>
  8. <span>Aquaman</span>
  9. <Toggle defaultChecked color="blue" />
  10. </ListItem>
  11. <ListItem>
  12. <span>Superman</span>
  13. <Toggle defaultChecked color="red" />
  14. </ListItem>
  15. <ListItem>
  16. <span>Hulk</span>
  17. <Toggle color="green" />
  18. </ListItem>
  19. <ListItem>
  20. <span>Spiderman (Disabled)</span>
  21. <Toggle disabled />
  22. </ListItem>
  23. <ListItem>
  24. <span>Ironman (Disabled)</span>
  25. <Toggle defaultChecked disabled />
  26. </ListItem>
  27. <ListItem>
  28. <span>Thor</span>
  29. <Toggle defaultChecked color="orange" />
  30. </ListItem>
  31. <ListItem>
  32. <span>Wonder Woman</span>
  33. <Toggle color="pink" />
  34. </ListItem>
  35. </List>

← Text Editor

Toolbar / Tabbar →