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

    17
  • Progress

    Progress

    1
  • Filter Chip

    Filter Chip

    1
  • Combobox

    Combobox

  • Textarea

    Textarea

  • Tooltip

    Tooltip

  • Card

    Card

  • Range Slider

    Range Slider

More in Buttons

View all
  • Button

    Button

    20
  • Button

    Button

    3
  • Button Group

    Button Group

    18
  • Button

    Button

    149
  • Icon Label Subtext Button

    Icon Label Subtext Button

    69
  • Button

    Button

    9
  • Button

    Button

    37
  • Texture Button

    Texture Button

    113