Switch API
import { Switch } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
checked | boolean | |
description | string | |
disabled | boolean | |
elevation | 'none' | 'low' | 'high' | |
headless | boolean | |
label | string | |
loading | boolean | |
name | string | |
onChange | (detail: SwitchDetail) => void | |
onInput | (detail: SwitchDetail) => void | |
required | boolean | |
shape | 'pill' | 'rounded' | 'square' | |
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).
Switch.Description props
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-switch>
Switch renders the ui-switch custom element from @editora/ui-core, which can also be used without React.
Attributes: aria-label, checked, description, disabled, elevation, headless, label, loading, name, required, shape, size, tabindex, tone, value, variant
Events: change, input