@jsvision/ui / buttonGroup
Function: buttonGroup()
buttonGroup(
buttons,options?):Group
Defined in: ui/src/controls/button-group.ts:140
Compose equal-width Buttons in stable row-major order.
Each supplied Button must be unattached and appear only once. Composition assigns its fixed width and parent, so sharing one live Button across multiple groups would corrupt both view trees.
Parameters
buttons
readonly Button[]
Buttons to compose in source, focus, and accelerator order.
options?
ButtonGroupOptions = {}
Minimum width, gaps, and optional maximum columns per row.
Returns
One row directly, or a vertical Group containing multiple equal-width Button rows.
Example
ts
import { Button, buttonGroup } from '@jsvision/ui';
const actions = [
new Button('Save'),
new Button('Apply'),
new Button('Delete'),
new Button('Set Default'),
new Button('Reset'),
];
const wrapped = buttonGroup(actions, { gap: 1, rowGap: 1, maxColumns: 3 });