ButtonGroup
Groups TUI buttons horizontally with a gap and consistent styles.
ButtonGroup
Design lines
1<Tabs defaultValue="tuix">2 <TabsList>3 <Tab value="tuix">TUIX</Tab>4 <Tab value="rubik">Rubik</Tab>5 </TabsList>6 <TabPanel value="tuix">7 <ButtonGroup fill="solid" color="primary" :buttons="[{ label: 'A', onClick: () => {} }, { label: 'B', onClick: () => {} }]" design="tuix" />8 </TabPanel>9 <TabPanel value="rubik">10 <ButtonGroup fill="solid" color="primary" :buttons="[{ label: 'A', onClick: () => {} }, { label: 'B', onClick: () => {} }]" design="rubik" />11 </TabPanel>12</Tabs>Demo
Group (buttons)
Minimal usage: pass buttons and the group renders one button per item.
1<ButtonGroup fill="solid" color="secondary" :buttons="[2 { icon: '↖', label: 'Left', onClick: () => {} },3 { icon: '⬆', label: 'Center', onClick: () => {} },4 { icon: '↗', label: 'Right', onClick: () => {} },5]" />67<ButtonGroup fill="outline" color="primary" :gap="0.8" :buttons="[8 { icon: '✕', label: 'Cancel', onClick: () => {} },9 { icon: '✓', label: 'Accept', onClick: () => {} },10]" />Fill (fill)
Solid and outline fill applied to the whole group.
1<ButtonGroup fill="solid" color="primary" :buttons="[2 { label: 'A', onClick: () => {} },3 { label: 'B', onClick: () => {} },4]" />5<ButtonGroup fill="outline" color="primary" :buttons="[6 { label: 'A', onClick: () => {} },7 { label: 'B', onClick: () => {} },8]" />Color (color)
The group color applied to every button.
1<ButtonGroup fill="solid" color="success" :buttons="[2 { label: 'A', onClick: () => {} },3 { label: 'B', onClick: () => {} },4]" />Gap (gap)
Two gap values showing the spacing between buttons.
1<ButtonGroup fill="solid" color="primary" :gap="0.2" :buttons="[2 { label: 'A', onClick: () => {} },3 { label: 'B', onClick: () => {} },4 { label: 'C', onClick: () => {} },5]" />6<ButtonGroup fill="solid" color="primary" :gap="1" :buttons="[7 { label: 'A', onClick: () => {} },8 { label: 'B', onClick: () => {} },9 { label: 'C', onClick: () => {} },10]" />Disabled (disabled)
The whole group disabled, plus a single disabled item.
1<ButtonGroup :disabled="true" fill="solid" color="primary" :buttons="[2 { label: 'A', onClick: () => {} },3 { label: 'B', onClick: () => {} },4]" />56<ButtonGroup fill="solid" color="primary" :buttons="[7 { label: 'Enabled', onClick: () => {} },8 { label: 'Item disabled', onClick: () => {}, disabled: true },9]" />Props
buttons
Array of buttons.
| Type | Default | Required |
|---|---|---|
Array<{label, icon?, onClick, fill?, color?, disabled?}> | — | ✅ |
Each button has this shape:
| Field | Type | Required | Description |
|---|---|---|---|
label | string | ✅ | Button text |
icon | string | ❌ | Icon or emoji |
onClick | (e: MouseEvent) => void | ✅ | Click callback |
fill | Fill | ❌ | Fill style |
color | Color | ❌ | Semantic color |
disabled | boolean | ❌ | Disable this button |
fill
Global fill for all buttons. Can be overridden per item.
| Type | Default | Required |
|---|---|---|
'solid' | 'outline' | 'clear' | 'solid' | ❌ |
color
Global color for all buttons. Can be overridden per item.
| Type | Default | Required |
|---|---|---|
'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'light' | 'medium' | 'dark' | 'primary' | ❌ |
gap
Spacing between buttons (in rem).
| Type | Default | Required |
|---|---|---|
number | 0.4 | ❌ |
disabled
Disables every button in the group. An individual item can also set its own disabled, which is OR-ed with the group value.
| Type | Default | Required |
|---|---|---|
boolean | false | ❌ |
design
Design line (or inherit from data-design), passed through to every button in the group.
| Type | Default | Required |
|---|---|---|
'tuix' | 'rubik' | — (inherits from data-design) | ❌ |
CSS Custom Properties
| Token | Default | Description |
|---|
Ver Theming para la convención completa.