Components
A polymorphic button built on Base UI's useRender. Ships 8 visual variants (default, secondary, outline, ghost, link, destructive, destructive-outline) and a full set of sizes including icon sizes (xs–xl). Has a built-in loading state that overlays an inline spinner and hides the label, a render prop for rendering as any element or as a child, and focus-visible / pressed styling out of the box.
npx @21st-dev/cli add cnippet.dev/cnippet-buttonLoading preview...
import { StarIcon } from "lucide-react";
import { Button } from "@/components/ui/cnippet-button";
export default function ButtonStar() {
return (
<Button className="pe-0" variant="outline">
<StarIcon aria-hidden="true" />
Star
<span className="relative ms-1 px-2 font-medium text-muted-foreground text-xs before:absolute before:inset-0 before:left-0 before:w-px before:bg-border">
589
</span>
</Button>
);
}
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...