Components

Button Group

Connect, toggle, and float groups of buttons.

Group buttons with UiButtonGroup, build segmented toggles with UiButtonToggleGroup, or pin floating actions with UiButtonFabGroup.

Connect buttons

<template>
  <UiButtonGroup connected>
    <UiButton variant="outline" text="Day" />
    <UiButton variant="outline" text="Week" />
    <UiButton variant="outline" text="Month" />
  </UiButtonGroup>
</template>

Add joined for a seamless (gap-less) group, or vertical to stack.

A group of only text buttons, like a row of icon actions, sits closer (--cffy-space-4): a text button has no visible edge, so its own padding already spaces it.

Build a toggle group

<script setup lang="ts">
import type { IButtonToggleOption } from '@colorffy/ui'
import { ref } from 'vue'

const view = ref('list')
const options: IButtonToggleOption[] = [
  { id: 'list', title: 'List', icon: '&#xe896;' },
  { id: 'grid', title: 'Grid', icon: '&#xe9b0;' },
]
</script>

<template>
  <UiButtonToggleGroup
    v-model="view"
    :options="options"
    aria-label="View mode"
  />
</template>

It is single-select (role="radiogroup"): arrow keys, Home and End move the selection, and disabled options are skipped.

Pin floating actions

<template>
  <UiButtonFabGroup>
    <UiButton variant="filled" color="primary" icon>
      <template #icon><UiIconMaterial icon-code="&#xe145;" /></template>
    </UiButton>
  </UiButtonFabGroup>
</template>

UiButtonGroup props

PropTypeDefaultDescription
connectedbooleanfalseReduced gap; the ends are pill-shaped (square when --cffy-shape-control is 0) and the inner corners follow --cffy-shape-control, up to a quarter of the button's height.
joinedbooleanfalseSeamless, gap-less group (requires connected).
verticalbooleanfalseStack buttons vertically.
customClassstring | null—Extra classes.

UiButtonToggleGroup props

PropTypeDefaultDescription
optionsIButtonToggleOption[]—Options: { id, title, icon?, iconClass?, text?, badge?, active?, disabled? }.
modelValuestring—Selected option id, bound with v-model. When bound, it overrides each option's active.
ariaLabelstring'Toggle button group'Accessible group label.

Emits: update:modelValue (the selected id) and optionClick(event, item), on pointer or keyboard selection; neither fires for disabled options.

UiButtonFabGroup props

PropTypeDefaultDescription
topbooleanfalseAnchor to the top instead of the bottom.
startbooleanfalseAnchor to the start (left) instead of the end.
customClassstring | string[] | Record<string, boolean> | null—Extra classes.

CSS variables

Set these on :root or on a wrapper. Connected and joined groups, and groups of only text buttons, keep their tight gap, the FAB group its mobile offsets, and the selected toggle its wider corners.

:root {
  --cffy-toggle-btn-active-border-color: var(--cffy-accent-a10);
  --cffy-fab-group-offset-block: var(--cffy-space-32);
}
VariableDefaultControls
--cffy-btn-group-gap--cffy-space-12 --cffy-space-8Gap of UiButtonGroup (row, column)
--cffy-chip-group-gap--cffy-space-8Gap of UiChipGroup
--cffy-fab-group-offset-block / --cffy-fab-group-offset-inline--cffy-space-24 + --cffy-space-4FAB distance from the screen edges
--cffy-fab-group-gap--cffy-space-16Space between FABs
--cffy-toggle-btn-group-gap--cffy-space-14Gap of UiButtonToggleGroup
--cffy-toggle-btn-bg-color / --cffy-toggle-btn-colortransparent / --cffy-on-backgroundToggle background and text
--cffy-toggle-btn-subtitle-color--cffy-muted-a10Toggle subtitle
--cffy-toggle-btn-border-width / --cffy-toggle-btn-border-color--cffy-border-width-sm / --cffy-outline-buttonToggle border
--cffy-toggle-btn-radius / --cffy-toggle-btn-padding--cffy-shape-control, up to --cffy-shape-container / --cffy-space-12Toggle corners and padding
--cffy-toggle-btn-hover-border-color--cffy-primary-a10Hovered or focused toggle outline
--cffy-toggle-btn-active-bg-color / --cffy-toggle-btn-active-border-color--cffy-surface-container-low / --cffy-primary-a10Selected toggle
--cffy-toggle-btn-easing / --cffy-toggle-btn-duration--cffy-ease-decelerate / --cffy-duration-300Toggle transitions
Copyright © 2026