Skip to content
  • Android
  • iOS
  • Web

Button Group

Offer a compact group of selectable actions.

Engine API NButtonGroupnayan-ui/components

Live examples

Example.tsx

Attributes

NButtonGroup attributes
NameTypeDefaultDetails
classNamestringOptionalSupported Tailwind-style utilities, resolved entirely in Rust. See the engine README.
buttonClassNamestringOptionalUtility classes for each segment.
itemsreadonly T[]OptionalPlain labels, item objects, or options with a string value.
selectedT | Selection<T>OptionalThe controlled selection. Option objects can be selected by value.
disabledbooleanOptional
onChange((value: Selection<T>) => void)Optional
keyExtractor((item: T, index: number) => Key)OptionalStable key for custom items.
renderButton((item: T, selected: boolean, index: number) => ReactNode)OptionalRender the contents of a segment.
ariaLabelstringOptional
valueT | Selection<T>OptionalAlias for selected.
defaultValueSelection<T>Optional
onValueChange((value: Selection<T>) => void)Optional
getKey((item: T, index: number) => Key)OptionalAlias for keyExtractor.
renderItem((item: T, index: number) => ReactNode)OptionalRender segment contents without using the selected state.
sizestring | numberOptional

Tags