Files
ionic-framework/packages/core/src/components/toggle
Cam Wiegert 94402d394c refactor(toggle) form usage and declarative set (#13914)
* chore(toggle) use debounce helper

* refactor(toggle) set attributes declaratively

* fix(toggle) set name instead of value, default value to on
2018-01-30 12:44:38 -06:00
..
2017-12-14 13:03:26 -05:00
2018-01-29 18:53:03 +01:00
2018-01-04 18:23:30 -05:00

ion-toggle

Toggles change the state of a single option. Toggles can be switched on or off by pressing or swiping them. They can also be checked programmatically by setting the checked property.

<!-- Default Toggle -->
<ion-toggle></ion-toggle>

<!-- Disabled Toggle -->
<ion-toggle disabled></ion-toggle>

<!-- Checked Toggle -->
<ion-toggle checked></ion-toggle>

<!-- Toggle Colors -->
<ion-toggle color="primary"></ion-toggle>
<ion-toggle color="secondary"></ion-toggle>
<ion-toggle color="danger"></ion-toggle>
<ion-toggle color="light"></ion-toggle>
<ion-toggle color="dark"></ion-toggle>

<!-- Toggles in a List -->
<ion-list>
  <ion-item>
    <ion-label>Pepperoni</ion-label>
    <ion-toggle slot="end" value="pepperoni" checked></ion-toggle>
  </ion-item>

  <ion-item>
    <ion-label>Sausage</ion-label>
    <ion-toggle slot="end" value="sausage" disabled></ion-toggle>
  </ion-item>

  <ion-item>
    <ion-label>Mushrooms</ion-label>
    <ion-toggle slot="end" value="mushrooms"></ion-toggle>
  </ion-item>
</ion-list>

Properties

checked

boolean

color

string

disabled

boolean

mode

name

string

The name of the control, which is submitted with the form data.

value

string

Attributes

checked

boolean

color

string

disabled

boolean

mode

name

string

The name of the control, which is submitted with the form data.

value

string

Events

ionBlur

ionChange

ionFocus

ionStyle


Built by StencilJS