Documentation
Components
Button

Button

Displays a button or a component that looks like a button.

Installation

npx shadcn@latest add https://exawizards.com/exabase/design/registry/button.json

Usage

import { Button } from "@/components/ui/button"
<Button variant="outline">Button</Button>

Link

You can use the buttonVariants helper to create a link that looks like a button.

import { buttonVariants } from "@/components/ui/button"
<Link className={buttonVariants({ variant: "outline" })}>Click here</Link>

Alternatively, you can set the asChild parameter and nest the link component.

<Button asChild>
  <Link href="/login">Login</Link>
</Button>

API

Props of the button element are also available.

PropTypeDefaultDescription
variant"outline" | "secondary" | "ghost" | "link" | "primary" | "primary-outline" | "primary-ghost" | "destructive" | "destructive-outline" | "destructive-ghost"primaryThe variant of the button.
size"default" | "sm" | "lg" | "icon" | "icon-sm"defaultThe size of the button.
asChildbooleanfalseChange the default rendered element for the one passed as a child, merging their props and behavior.

Examples

Variant

Disabled

Size

With Icon

Icon

AsChild