ion-toggle

See the Pen by Ionic (@ionic) on CodePen.

A toggle is an animated switch which binds a given model to a boolean.

Allows dragging of the switch’s nub.

The toggle behaves like any AngularJS checkbox otherwise.

Usage

Below is an example of a toggle directive which is wired up to the airplaneMode model and has the toggle-calm CSS class assigned to the inner element.

<ion-toggle ng-model="airplaneMode" toggle-class="toggle-calm">Airplane Mode</ion-toggle>

API

Attr Type Details
toggle-class
(optional)
string

Sets the CSS class on the inner label.toggle element created by the directive.