Button link
npx shadcn add @klarhimmel/buttonCopy for AIDetailsAbout, usage, props and more
An anchor styled as a button, for navigation that should look like an action.
When to use
Use for
A call to action that goes to another page.
Not for
Actions that change data. Use Button.
Pairs with
Hero and call-to-action blocks.
Preview
Import
Import
- Files
- button.tsx, in components/klarhimmel/ui/. With it: editing, theme, utils. npm: radix-ui.
- Render in
- Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'primary' | 'secondary' | 'ghost' | 'accent' | 'soft' | 'danger' | 'primary' | Same variants as Button. |
size | 'sm' | 'md' | 'lg' | 'md' | Same sizes as Button. |
icon | ReactNode | - | Icons before and after the label. |
iconEnd | ReactNode | - | Icons before and after the label. |
full | boolean | - | Stretch to the container width. |
native attributes | AnchorHTMLAttributes | - | Every native attribute of the element passes through, className included. |