sc1m
uibuttonsource: ok · hit
Button
Button component built on Base UI, styled with sc1m tokens.
npx shadcn add "https://sc1m.vercel.app/r/button.json"free
No selection tags yet — empty means no evidence, not lack of support.
Dependencies
Bundle weight · lightRegistry dependencies
https://sc1m.vercel.app/r/tokens.jsonhttps://sc1m.vercel.app/r/cn.json
Files1 · source cached 10/15/2026, 7:29:38 AM
src/components/ui/button/button.tsx
import * as React from "react";
import { cn } from "@/lib/cn";
type Variant = "primary" | "secondary" | "ghost" | "danger";
type Size = "sm" | "md" | "lg";
const variants: Record<Variant, string> = {
primary: "bg-accent text-accent-fg hover:bg-accent-hover",
secondary: "border border-line bg-surface-raised text-fg hover:bg-surface",
ghost: "text-fg hover:bg-surface",
danger: "bg-danger text-danger-fg hover:opacity-90",
};
const sizes: Record<Size, string> = {
sm: "h-8 px-3 text-sm rounded-md",
md: "h-9 px-4 text-sm rounded-md",
lg: "h-10 px-5 text-base rounded-lg",
};
export interface ButtonProps extends React.ComponentPropsWithRef<"button"> {
variant?: Variant;
size?: Size;
}
export function Button({
variant = "primary",
size = "md",
className,
...props
}: ButtonProps) {
return (
<button
className={cn(
"inline-flex items-center justify-center gap-2 font-medium select-none",
"transition-colors duration-fast ease-out-quad",
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
"disabled:pointer-events-none disabled:opacity-50",
variants[variant],
sizes[size],
className,
)}
{...props}
/>
);
}