Skip to main content

Toggle

Ask AIView as Markdown
Copy a prompt to ask an AI assistant about this page.

Toggle switches enable users to toggle between an on and off state.

Toggle - Code

Basic​

Custom label​

Disabled​

Checked​

Indeterminate​

API for ix-toggle​

Properties​

Description

Whether the slide-toggle element is checked or not.

Attribute
checked
Type
boolean
Default
false
Description

Whether the slide-toggle element is disabled or not.

Attribute
disabled
Type
boolean
Default
false
Description

Hide on and off text

Attribute
hide-text
Type
boolean
Default
false
Description

If true the control is in indeterminate state

Attribute
indeterminate
Type
boolean
Default
false
Description

Name of the checkbox component

Attribute
name
Type
string | undefined
Description

Required state of the checkbox component.

If true, checkbox needs to be checked to be valid

Attribute
required
Type
boolean
Default
false
Description

Text for indeterminate state

Attribute
text-indeterminate
Type
string
Default
'Mixed'
Description

Text for off state

Attribute
text-off
Type
string
Default
'Off'
Description

Text for on state

Attribute
text-on
Type
string
Default
'On'
Description

Value of the checkbox component

Attribute
value
Type
string
Default
'on'

Events​

Description

An event will be dispatched each time the slide-toggle changes its value.

Event
checkedChange
Detail
boolean
Description

An event will be dispatched each time the toggle is blurred.

Event
ixBlur
Detail
void