Toggle Switch
Angular Bootstrap 5 Toggle Switch component
A switch is a simple component used for activating one of two predefined options. Commonly used as an on/off button.
Basic example
A switch has the markup of a custom checkbox but uses the
.form-switch
class to render a toggle switch. Add
mdbCheckbox
directive to the input element to use all switch features.
Toggle Switch - API
Import
Inputs
Name | Type | Default | Description |
---|---|---|---|
checked |
Boolean | false |
Changes switch checked state |
disabled |
Boolean | false |
Changes switch disabled state |
value |
any | - |
Changes switch value |
Methods
Name | Description | Example |
---|---|---|
toggle
|
Manually toggle a switch |
switch.toggle()
|