Primitives
Button Group
Visually joins a row of outline Buttons with shared borders and rounded ends.
Motionnone — inherits Button hover/tap presets
Install
Install Kineto and follow the theme setup once in your app.
bash
npm install kinetotsx
import { ButtonGroup } from "kineto/button-group";Preview
tsx
import * as React from "react";
import { cn } from "@/lib/cn";
/**
* Visually joins a row of Buttons (use `variant="outline"`): shared borders, ends rounded,
* and the focused button lifts above its neighbors. Composition-only — pass Buttons as children.
*/
const ButtonGroup = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
role="group"
className={cn(
"inline-flex items-center [&>*:not(:first-child)]:-ml-px [&>*:not(:first-child)]:rounded-l-none [&>*:not(:last-child)]:rounded-r-none [&>*]:focus-visible:relative [&>*]:focus-visible:z-10",
className
)}
{...props}
/>
));
ButtonGroup.displayName = "ButtonGroup";
export { ButtonGroup };src/components/ui/button-group.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | Button[] | — | Pass Buttons (use variant="outline"). |