layout: "docs_api" version: "1.1.0" versionHref: "/docs" path: "api/directive/ionToggle/"
title: "ion-toggle" header_sub_title: "Directive in module ionic" doc: "ionToggle"
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.
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>
| Attr | Type | Details |
|---|---|---|
|
toggle-class
(optional)
|
string
|
Sets the CSS class on the inner |