Viora LogoViora UI
Login

Expanding Button Group

A compact pill of icon buttons where hover or focus reveals labels and slides neighbours aside with inline confirmations.

expanding-button-group.tsx
Loading source code...

Installation

pnpm dlx viora-ui@latest add expanding-button-group
npx viora-ui@latest add expanding-button-group
yarn viora-ui@latest add expanding-button-group
bunx --bun viora-ui@latest add expanding-button-group

Usage

import { Archive, Clock3, Forward, Reply, Trash2 } from "lucide-react";
import { ExpandingButtonGroup } from "@/components/arc/expanding-button-group/expanding-button-group";

export function MessageActions({ message }: { message: { id: string } }) {
  return (
    <ExpandingButtonGroup
      label="Message actions"
      defaultExpanded="reply"
      items={[
        { id: "reply", label: "Reply", icon: <Reply size={16} />, onSelect: () => console.log("reply") },
        { id: "forward", label: "Forward", icon: <Forward size={16} />, onSelect: () => console.log("forward") },
        { id: "archive", label: "Archive", doneLabel: "Archived", icon: <Archive size={16} />, onSelect: () => console.log("archive") },
        { id: "snooze", label: "Snooze", doneLabel: "Snoozed", icon: <Clock3 size={16} />, onSelect: () => console.log("snooze") },
        { id: "delete", label: "Delete", doneLabel: "Deleted", tone: "danger", icon: <Trash2 size={16} />, onSelect: () => console.log("delete") },
      ]}
    />
  );
}

API Reference

ExpandingButtonGroup

PropTypeDefaultDescription
itemsExpandingButtonGroupItem[]—Toolbar action items.
labelstring—Accessible name of toolbar.
size"sm" | "md""md"Pill size geometry.
confirmDurationnumber1400Duration in ms to display checkmark confirmation.

Built by Otis

Last updated: 10/12/2026