Toggle API
import { Toggle } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
disabled | boolean | |
elevation | 'default' | 'none' | |
headless | boolean | |
iconOff | string | |
iconOn | string | |
loading | boolean | |
name | string | |
onChange | (detail: ToggleDetail) => void | |
onInput | (detail: ToggleDetail) => void | |
pressed | boolean | |
required | boolean | |
shape | 'default' | 'square' | 'pill' | |
size | 'sm' | 'md' | 'lg' | |
tone | 'brand' | 'success' | 'warning' | 'danger' | |
value | string | |
variant | 'default' | 'soft' | 'outline' | 'contrast' | 'minimal' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-toggle>
Toggle renders the ui-toggle custom element from @editora/ui-core, which can also be used without React.
Attributes: aria-label, disabled, elevation, headless, icon-off, icon-on, loading, name, pressed, required, shape, size, tabindex, tone, value, variant
Events: change, input