Toggle Svelte Component

Toggle Svelte component represents Toggle component.

Toggle Components

There are following components included:

  • Toggle

Toggle Properties

<Toggle> properties
initbooleantrueInitializes Toggle
namestringToggle input name
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

<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

<Toggle> methods
.toggle()Toggle checkbox state


  <Navbar title="Toggle"></Navbar>
  <BlockTitle>Super Heroes</BlockTitle>
  <List simpleList>
      <Toggle checked></Toggle>
      <Toggle checked color="blue"></Toggle>
      <Toggle checked color="red"></Toggle>
      <Toggle color="green"></Toggle>
      <span>Spiderman (Disabled)</span>
      <Toggle disabled></Toggle>
      <span>Ironman (Disabled)</span>
      <Toggle checked disabled></Toggle>
      <Toggle checked color="orange"></Toggle>
      <span>Wonder Woman</span>
      <Toggle color="pink"></Toggle>

  import {Page, Navbar, BlockTitle, List, ListItem, Toggle} from 'framework7-svelte';