Button
Free · MITshadcn's button in Candor's theme, with a locked state for <Locked> (dimmed, and says why).
Preview
Install
With the Candor CLI
First time? Get started sets up the registry and theme. Or with shadcn directly: npx shadcn@latest add @candor/button
Brings in: render-prop, utils · npm: class-variance-authority@^0.7.1, radix-ui@^1.8.1
Usage
"use client"
import { Button } from "@/components/ui/button"
export default function Example() {
return (
<div className="flex flex-wrap items-center gap-3">
<Button>Approve</Button>
<Button variant="outline">Ask for changes</Button>
<Button variant="ghost">Cancel</Button>
<Button variant="destructive">Delete history</Button>
<Button size="sm" asChild>
<a href="#queue">Open the queue</a>
</Button>
</div>
)
}<Button>
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | undefined | — | Render the child element (a link, say) with the button's styles instead of a <button>. |
Also takes the props of React.ComponentProps<"button">VariantProps<typeof buttonVariants>RenderProp.