Skip to main content
Version: Next

Toggle API

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

Props​

PropTypeDescription
disabledboolean
elevation'default' | 'none'
headlessboolean
iconOffstring
iconOnstring
loadingboolean
namestring
onChange(detail: ToggleDetail) => void
onInput(detail: ToggleDetail) => void
pressedboolean
requiredboolean
shape'default' | 'square' | 'pill'
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).

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