87.7k

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

Installation

pnpm dlx shadcn@latest add button

Usage

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

You can use the asChild prop to make another component look like a button. Here's an example of a link that looks like a button.

import { Link } from "next/link"
 
import { Button } from "@/components/ui/button"
 
export function LinkAsButton() {
  return (
    <Button asChild>
      <Link href="/login">Login</Link>
    </Button>
  )
}

Examples

Default

Secondary

Destructive

Outline

Ghost

Icon

With Icon

Loading