Skip to content

ButtonGroup ​

Groups TUI buttons horizontally with a gap and consistent styles.

ButtonGroup

Design lines ​

vue
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.

vue
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.

vue
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.

vue
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.

vue
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.

vue
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.

TypeDefaultRequired
Array<{label, icon?, onClick, fill?, color?, disabled?}>—✅

Each button has this shape:

FieldTypeRequiredDescription
labelstring✅Button text
iconstring❌Icon or emoji
onClick(e: MouseEvent) => void✅Click callback
fillFill❌Fill style
colorColor❌Semantic color
disabledboolean❌Disable this button

fill ​

Global fill for all buttons. Can be overridden per item.

TypeDefaultRequired
'solid' | 'outline' | 'clear''solid'❌

color ​

Global color for all buttons. Can be overridden per item.

TypeDefaultRequired
'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'light' | 'medium' | 'dark''primary'❌

gap ​

Spacing between buttons (in rem).

TypeDefaultRequired
number0.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.

TypeDefaultRequired
booleanfalse❌

design ​

Design line (or inherit from data-design), passed through to every button in the group.

TypeDefaultRequired
'tuix' | 'rubik'— (inherits from data-design)❌

CSS Custom Properties ​

TokenDefaultDescription

Ver Theming para la convención completa.