Skip to main content

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

ParameterType
propsToggleProps
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

MemberType
checkedboolean
disabledboolean
iconCheckedReact.ReactElement
iconUncheckedReact.ReactElement
idstring
labelstring
namestring
onChange(ev) => void
sizetoggleSize

Source

libs/design-system-core/src/components/Toggle/index.tsx:9


toggleSize

toggleSize: "small" | "large"

Source

libs/design-system-core/src/components/Toggle/index.tsx:7