File size: 714 Bytes
7f9f518 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cn } from "@/lib/utils";
type Props = React.ButtonHTMLAttributes<HTMLButtonElement> & { asChild?: boolean };
export function Button({ asChild, className, ...props }: Props) {
const Comp = asChild ? Slot : "button";
return (
<Comp
className={cn(
"inline-flex items-center justify-center rounded-2xl px-4 py-2 text-sm font-medium transition",
"bg-neutral-900 text-white hover:bg-neutral-800 active:bg-neutral-950",
"focus:outline-none focus:ring-2 focus:ring-neutral-300",
"disabled:opacity-50 disabled:cursor-not-allowed",
className
)}
{...props}
/>
);
}
|