Componentform0.38 KB gzipZero dependencies

Button Group

Joins buttons with rounded outer corners, internal separators, and sliding hover highlight.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add button-group

Or install the full npm package:

npm install bigbullui

Usage

tsx7 lines
import { ButtonGroup, ButtonGroupItem } from "@/components/ui/button-group"; <ButtonGroup>  <ButtonGroupItem>Day</ButtonGroupItem>  <ButtonGroupItem>Week</ButtonGroupItem>  <ButtonGroupItem>Month</ButtonGroupItem></ButtonGroup>

Source code

button-group.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxbutton-group.tsx58 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export type ButtonGroupItemProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {  className?: string;  asChild?: boolean;}; export type ButtonGroupProps = {  className?: string;  children?: React.ReactNode;}; const separator = "border-e border-border/50 h-[1px]"; const ButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupProps>(

Props

PropTypeDescription
classNamestringOptional Tailwind or custom CSS classes merged with component styles.
childrenReact.ReactNodeGrouped buttons.