Button group
React componentKeep related actions aligned and meaningfully grouped.
Try it out
Use the live controls or open the Code tab to view and copy the example.
API reference
Generated from the package’s TypeScript exports. Standard React event and ARIA attributes are also accepted where the component wraps a native element.
| Prop | Type | Description |
|---|---|---|
defaultChecked | boolean | undefined | Standard React / HTML attribute passed to the underlying element. |
defaultValue | string | number | readonly string[] | undefined | Initial value for uncontrolled usage. |
className | string | undefined | Additional CSS class names. |
id | string | undefined | Standard React / HTML attribute passed to the underlying element. |
style | CSSProperties | undefined | Inline styles, including CSS custom property overrides. |
rel | string | undefined | Standard React / HTML attribute passed to the underlying element. |
children | ReactNode | Content rendered inside the component. |
onFocus | FocusEventHandler<HTMLDivElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
onBlur | FocusEventHandler<HTMLDivElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
onChange | ChangeEventHandler<HTMLDivElement, Element> | undefined | Standard React / HTML attribute passed to the underlying element. |
onError | ReactEventHandler<HTMLDivElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
onClick | MouseEventHandler<HTMLDivElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
labelRequired | string | A meaningful visible or accessible label. |
Accessibility & interaction
Maintain an understandable accessible name and preserve visible focus for all actions.
Visible focus, reduced motion, and both color themes are shared across staqui. Choose labels and document structure that make sense in your application; automated checks do not replace assistive-technology testing.
Variants & implementation notes
Named React children replace primary-action and secondary-actions slots. All actions retain independent tab stops.
Use the typed API above for the supported variants. The example demonstrates the primary composition; shared controls inherit hover, focus, active and disabled treatment where applicable.