Button

PreviousNext

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

button-demo

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

button-default

Liquid Glass

button-liquid-glass

Metal

button-metal

Secondary

button-secondary

Destructive

button-destructive

Outline

button-outline

Ghost

button-ghost

button-link

Icon

button-icon

With Icon

button-with-icon

Loading

button-loading