About
A connected control group primitive for buttons, inputs, separators, and text addons. Children join into one control with shared borders and rounded outer corners, horizontally or vertically; GroupText adds a text addon and GroupSeparator a divider.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Group to your project and fits it to your theme.
Code
How Group is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import * as React from "react";
import { Group, GroupSeparator, GroupText } from "@/components/ui/retab-group";
const button = "relative inline-flex h-9 cursor-pointer items-center justify-center gap-2 rounded-lg border border-input bg-background px-3 text-sm font-medium shadow-xs/5 outline-none transition-colors hover:bg-accent focus-visible:ring-[3px] focus-visible:ring-ring/24 data-[pressed]:bg-accent";
export default function GroupDemo() {
const [view, setView] = React.useState("Day");
return (
<div className="flex flex-col items-center gap-6">
<Group aria-label="Calendar view">
{["Day", "Week", "Month"].map((label, index) => (
<React.Fragment key={label}>
{index > 0 ? <GroupSeparator /> : null}
<button
type="button"
data-slot="button"
data-pressed={view === label ? "" : undefined}
aria-pressed={view === label}
className={button}
onClick={() => setView(label)}
>
{label}
</button>
</React.Fragment>
))}
</Group>
<Group aria-label="Website">
<GroupText>https://</GroupText>
<GroupSeparator />
<input
data-slot="input-control"
aria-label="Domain"
defaultValue="retab.com"
className="h-9 w-44 rounded-lg border border-input bg-background px-3 text-sm shadow-xs/5 outline-none focus-visible:border-ring"
/>
</Group>
</div>
);
}









