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>
);
}
















