Skip to main content
Version: Next

ToggleGroup API

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

Props​

PropTypeDescription
activation'auto' | 'manual'
allowEmptyboolean
childrenReact.ReactNode
density'compact' | 'default' | 'comfortable'
disabledboolean
elevation'default' | 'none'
headlessboolean
multipleboolean
onChange(detail: ToggleGroupDetail) => void
onInput(detail: ToggleGroupDetail) => void
onValueChange(detail: ToggleGroupDetail) => void
orientation'horizontal' | 'vertical'
requiredboolean
shape'default' | 'square' | 'pill'
size'sm' | 'md' | 'lg'
valuestring | string[]
variant'default' | 'soft' | 'contrast' | 'minimal'

Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).

ToggleGroup.Item 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-group>​

ToggleGroup renders the ui-toggle-group custom element from @editora/ui-core, which can also be used without React.

Attributes: activation, allow-empty, aria-label, density, disabled, elevation, headless, multiple, orientation, required, shape, size, value, variant

Events: change, input