Button

The Button component triggers actions, submits forms, or acts as a styled button.

Primary

import { Button } from "@/components/ui/button"

export default function Example() {
  return (
    <div className="flex h-8 w-full items-center justify-center">
      <Button variant="primary">Launch The Rocket</Button>
    </div>
  )
}

Secondary

import { Button } from "@/components/ui/button"

export default function Example() {
  return (
    <div className="flex h-8 w-full items-center justify-center">
      <Button variant="secondary">Maybe Later</Button>
    </div>
  )
}

Outline

import { Button } from "@/components/ui/button"

export default function Example() {
  return (
    <div className="flex h-8 w-full items-center justify-center">
      <Button variant="outline">Learn More If You Want</Button>
    </div>
  )
}

Ghost

import { Button } from "@/components/ui/button"

export default function Example() {
  return (
    <div className="flex h-8 w-full items-center justify-center">
      <Button variant="ghost">I'm Barely Here</Button>
    </div>
  )
}

Danger

import { Button } from "@/components/ui/button"

export default function Example() {
  return (
    <div className="flex h-8 w-full items-center justify-center">
      <Button variant="danger">Delete The Bank Account</Button>
    </div>
  )
}

Success

import { Button } from "@/components/ui/button"

export default function Example() {
  return (
    <div className="flex h-8 w-full items-center justify-center">
      <Button variant="success">Withdraw $10,000</Button>
    </div>
  )
}

Icon

import { RocketIcon } from "lucide-react"
import { Button } from "@/components/ui/button"

export default function Example() {
  return (
    <div className="flex h-8 w-full items-center justify-center gap-3">
      <Button variant="primary" size="icon" aria-label="Launch the rocket">
        <RocketIcon />
      </Button>
      <Button variant="secondary" size="icon" aria-label="Launch the rocket">
        <RocketIcon />
      </Button>
      <Button variant="outline" size="icon" aria-label="Launch the rocket">
        <RocketIcon />
      </Button>
      <Button variant="ghost" size="icon" aria-label="Launch the rocket">
        <RocketIcon />
      </Button>
    </div>
  )
}

With Icon

import {
  ArrowRightIcon,
  CoffeeIcon,
  GhostIcon,
  RocketIcon,
  SparklesIcon,
  WalletIcon,
} from "lucide-react"
import { Button } from "@/components/ui/button"

export default function Example() {
  return (
    <div className="flex h-8 w-full flex-col items-center justify-center gap-3">
      <div className="flex items-center gap-3">
        <Button>
          <RocketIcon />
          Launch The Rocket
        </Button>
        <Button>
          Withdraw $10,000
          <WalletIcon />
        </Button>
      </div>
      <div className="flex items-center gap-3">
        <Button variant="secondary">
          <CoffeeIcon />
          Maybe Later
        </Button>
        <Button variant="secondary">
          Learn More If You Want
          <ArrowRightIcon />
        </Button>
      </div>
      <div className="flex items-center gap-3">
        <Button variant="ghost">
          <GhostIcon />
          I'm Barely Here
        </Button>
        <Button variant="ghost">
          Make It Fancy
          <SparklesIcon />
        </Button>
      </div>
    </div>
  )
}

Disabled

import { Button } from "@/components/ui/button"

export default function Example() {
  return (
    <div className="flex h-8 w-full items-center justify-center gap-3">
      <Button disabled>Maybe Later</Button>
      <Button variant="danger" disabled>
        Delete The Bank Account
      </Button>
    </div>
  )
}

Props

PropTypeDefault
variant"primary" | "secondary" | "outline" | "ghost" | "danger" | "success""primary"
size"md" | "icon""md"
disabledbooleanfalse
type"button" | "submit" | "reset""button"