Toggle
Components
>
Editing Data
>
Toggle
Use this component to...
Allow the user to change a Boolean value
See this component in action...
Overview
Use the toggle component to allow the user to change a Boolean value.
The toggle acts like a physical switch that allows users to turn things on or off, like a light switch.
If a label is specified, it displays to the right of the toggle.
Development
Web component development
Component reference
rui-toggle
rui-toggle
Module: rui-input
-
Package: @jkhy/responsive-ui-wc
Allows the user to change a Boolean value
| Name | Type | Default | Description | |
|---|---|---|---|---|
| value | boolean | false | Bind this property to a backing value in your controller to set the initial value for the toggle. | |
| rui-value-change | event | This event fires when the toggle’s value changes. The new value is passed in the event detail. Use this event to update the backing value in your controller. | ||
| labelText | string | '' | If the toggle needs to be labeled, specify its label text with this property. | |
| isDisabled | boolean | false | Specifies whether the toggle is disabled. |
Implementation
Begin by importing the rui-input module into your application.
Example:
Angular wrapper development
Wrapper reference
jha-toggle
jha-toggle
Module: JhaToggleModule
-
Package: @jkhy/responsive-ui-angular
Allows the user to change a Boolean value
| Name | Type | Default | Description | |
|---|---|---|---|---|
| jhaToggleVal | boolean | false | If the toggle is part of a template-driven form, two-way bind this property to a backing value. | |
| jhaLabel | string | '' | If the toggle needs to be labeled, specify its label text with this property. | |
| jhaIsDisabled | boolean | false | Specifies whether the toggle is disabled. | |
| jhaToggleValChange | event | This event fires when the toggle’s value changes. |
Implementation
Begin by importing the JhaToggleModule module into your application.
Reactive form example:
Template driven form example:
Design
Figma design
Figma design info
| Dev Component | Design Component Name |
|---|---|
| Toggle | RUI / Buttons / Toggle Switch on the Checked property if the toggle is on. |
Adobe XD design
Adobe XD design info
- Sample App - Buttons
| Dev Component | Design Component Name |
|---|---|
| Toggle - on | JHA / Buttons / Toggle / On |
| Toggle - off | JHA / Buttons / Toggle / Off |
Support options
Did this page help you?
Last updated Tue Feb 13 2024