Skip to content
Klarhimmel UI

Button link

npx shadcn add @klarhimmel/button
DetailsAbout, 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

button-link.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { ButtonLink } from '@/components/klarhimmel/ui/button';

export default function Example() {
  return (
    <Theme theme="brand">
      <ButtonLink href="/pricing" variant="secondary">See pricing</ButtonLink>
    </Theme>
  );
}

Import

Import

import { ButtonLink } from '@/components/klarhimmel/ui/button';
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

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'ghost' | 'accent' | 'soft' | 'danger''primary'Same variants as Button.
size'sm' | 'md' | 'lg''md'Same sizes as Button.
iconReactNode-Icons before and after the label.
iconEndReactNode-Icons before and after the label.
fullboolean-Stretch to the container width.
native attributesAnchorHTMLAttributes-Every native attribute of the element passes through, className included.

Accessibility

KeyDoes
EnterFollows the link
TabMoves focus