Toggle
Components
Toggle()
Toggle(
props
,context
?):ReactNode
The Toggle component offers a quick way to include a toggle input in your app. The component supports many customization options such as size, icons for checked/unchecked states, and handling changes through an event handler.
Parameters
Parameter | Type |
---|---|
props | ToggleProps |
context ? | any |
Returns
ReactNode
Example
<Toggle checked={false} label={'Agree?'} onChange={ToggleChangeHandler} size="small" />
Source
libs/design-system-core/src/components/Toggle/index.tsx:41
Props
ToggleProps
ToggleProps:
object
Type declaration
Member | Type |
---|---|
checked | boolean |
disabled | boolean |
iconChecked | React.ReactElement |
iconUnchecked | React.ReactElement |
id | string |
label | string |
name | string |
onChange | (ev ) => void |
size | toggleSize |
Source
libs/design-system-core/src/components/Toggle/index.tsx:9
toggleSize
toggleSize:
"small"
|"large"