Skip to main content
Version: Next

Switch API

import { Switch } from '@editora/ui-react';

Props​

PropTypeDescription
checkedboolean
descriptionstring
disabledboolean
elevation'none' | 'low' | 'high'
headlessboolean
labelstring
loadingboolean
namestring
onChange(detail: SwitchDetail) => void
onInput(detail: SwitchDetail) => void
requiredboolean
shape'pill' | 'rounded' | 'square'
size'sm' | 'md' | 'lg'
tone'brand' | 'success' | 'warning' | 'danger'
valuestring
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