Skip to content

The platform for continuously improving AI agents.

636 B
Raw Blame
import type * as React from "react";

import { cn } from "@/lib/utils";

/** Buttons joined into one bordered control, divided by hairlines. */
export function ButtonGroup({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      className={cn(
        "inline-flex w-fit items-center rounded-sm border border-border bg-card [&>button]:rounded-none [&>button]:border-0 [&>button+button]:border-l [&>button+button]:border-border/70 [&>button:first-child]:rounded-l-sm [&>button:last-child]:rounded-r-sm",
        className
      )}
      data-slot="button-group"
      role="group"
      {...props}
    />
  );
}