Segmented
Base UI-powered Segmented control — toggle-group semantics with a sliding active indicator. Drops antd dependency in favor of @base-ui/react/toggle-group.
import { Segmented } from '@lobehub/ui/base-ui';Data Entry
Default
Loading preview
Atom Components
Loading preview
APIs
Segmented
Segmented properties
blockbooleanDefaults to
false.classNamestringclassNamesSegmentedClassNamesdefaultValueValuedisabledbooleanDefaults to
false.glassbooleanDefaults to
false.idstringnamestringonChange(value: Value) => voidoptionsSegmentedOptions<Value>refnull | (instance: HTMLDivElement | null) => void | (() => VoidOrUndefinedOnly) | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES] | RefObject<HTMLDivElement | null>shadowbooleanDefaults to
false.size'small' | 'middle' | 'large'Defaults to
"middle".styleCSSPropertiesstylesSegmentedStylesvalueValuevariant'outlined' | 'filled'Defaults to
"filled".verticalbooleanDefaults to
false.
SegmentedOption
| Property | Description | Type | Default |
|---|---|---|---|
| value | Unique value | string | - |
| label | Option label | ReactNode | - |
| icon | Leading icon | ReactNode | - |
| disabled | Whether the item is disabled | boolean | false |
| title | Native title attribute | string | - |
options also accepts an array of plain strings as shorthand: ['Light', 'Dark'] is equivalent to [{ value: 'Light', label: 'Light' }, ...].
Helpful?