Klarhimmel UI

Button link

Stable

An anchor styled as a button, for navigation that should look like an action.

npx shadcn add @klarhimmel/button

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>
  );
}

Install

Import

import { ButtonLink } from '@/components/klarhimmel/ui/button';
Lands in
components/klarhimmel/ui/button.tsx, plus cn() and the theme item if they are missing. Import theme.css after Tailwind.
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.

API reference

PropTypeDefaultDescription
hrefstring-Destination. Unsafe schemes become "#".
variant'primary' | 'secondary' | 'ghost' | 'accent' | 'soft''primary'Same variants as Button.
size'sm' | 'md' | 'lg''md'Same sizes as Button.
icon / iconEndReactNode-Icons before and after the label.
fullbooleanfalseStretch to the container width.

Accessibility

KeyDoes
EnterFollows the link
TabMoves focus