Browse documentation
Button group
Keep related actions together without losing each button's own label and behavior.
Import
Load the optional component layer before using the examples below.
Ruby
require "zaniah/ui"Example
Pass buttons as children. Use a group only when the actions are closely related.
Rendered example

Ruby
Zaniah::UI::ButtonGroup.new(
Zaniah::UI::Button.new("Day", size: :sm),
Zaniah::UI::Button.new("Week", size: :sm)
)
API summary
Constructor options and behaviors are drawn from the component reference.
| Component | Constructor and methods | Variants or behavior |
|---|---|---|
ButtonGroup | (*buttons), child | horizontal |
Accessibility
The group contains independently focusable buttons.
| Component | Semantic role |
|---|---|
ButtonGroup | group |