alexander-rukin

Button Group

Buttons

About

A set of buttons fused edge-to-edge into one segmented control, usable either as a single-choice radio-style switch or as a wrapper that joins existing buttons into one toolbar.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Button Group to your project and fits it to your theme.

Code

How Button Group is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import * as React from "react";
import ButtonGroup from "@/components/ui/button-group";

export default function ButtonGroupSegmentedDemo() {
  const [view, setView] = React.useState("list");

  return (
    <div
      style={{
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        minHeight: 240,
        width: "100%",
        background: "var(--background)",
        color: "var(--foreground)",
      }}
    >
      <ButtonGroup
        value={view}
        onChange={setView}
        items={[
          { value: "list", label: "List" },
          { value: "grid", label: "Grid" },
          { value: "board", label: "Board" },
        ]}
      />
    </div>
  );
}

More by alexander-rukin

View all
  • Carousel

    Carousel

    16
  • Combobox

    Combobox

  • Textarea

    Textarea

  • Tooltip

    Tooltip

  • Card

    Card

  • Range Slider

    Range Slider

  • Progress

    Progress

  • Filter Chip

    Filter Chip

More in Buttons

View all
  • Hero Button

    Hero Button

    21
  • Eclipse Button

    Eclipse Button

    9
  • Button

    Button

    141
  • Button

    Button

    19
  • Texture Button

    Texture Button

    111
  • HeroUI Toggle Button

    HeroUI Toggle Button

  • Random Letter Swap CTA Buttons

    Random Letter Swap CTA Buttons

    64
  • Water Ripple Button

    Water Ripple Button

    4