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.

Build a toggle group

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

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

<template>
  <UiButtonToggleGroup
    :options="options"
    aria-label="View mode"
    @on-option-click="(event, item) => current = item.id"
  />
</template>

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; only the first/last corners are rounded.
joinedbooleanfalseSeamless, gap-less group (requires connected).
verticalbooleanfalseStack buttons vertically.
customClassstring | nullExtra classes.

UiButtonToggleGroup props

PropTypeDefaultDescription
optionsIButtonToggleOption[]Options: { id, title, icon?, text?, badge?, active?, disabled? }.
ariaLabelstringAccessible group label.
groupLabelstringVisible group label.

Emits: onOptionClick(event, item).

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> | nullExtra classes.
Copyright © 2026