Button

Base UI button with default, outline, secondary, ghost, destructive and link variants. Sizes run from xs to lg plus four square icon sizes, with focus ring and invalid states included.

Open the preview in a new tab
import { Button } from "@/components/ui/button"

/** Button at the large size. */
export default function ButtonDemo() {
  return <Button size="lg">Browse components</Button>
}

Installation

pnpm dlx shadcn add @01orbital/button
npx shadcn add @01orbital/button
yarn shadcn add @01orbital/button
bunx --bun shadcn add @01orbital/button

Add the @01orbital registry to components.json once (install guide), then run the command.

It lands at components/ui/button.tsx, as source you own and edit.

Examples

01

button-frosted

Example 01 · button-frosted

Frosted

A frosted Button over a rising Moon Sphere: a see-through fill, a hairline and a soft inner glow, blurred over the light behind.

pnpm dlx shadcn add @01orbital/button-frosted
npx shadcn add @01orbital/button-frosted
yarn shadcn add @01orbital/button-frosted
bunx --bun shadcn add @01orbital/button-frosted
import { MoonSphere } from "@/components/orbs/moon-sphere"
import { Button } from "@/components/ui/button"

export default function ButtonFrosted() {
  return (
    <div className="dark relative isolate grid min-h-72 w-full flex-1 place-items-center overflow-hidden bg-background p-10 text-foreground">
      <MoonSphere
        size={460}
        className="absolute top-[calc(50%-3.5rem)] left-1/2 -z-10 -translate-x-1/2"
      />
      <Button
        type="button"
        className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
      >
        Explore the gallery
      </Button>
    </div>
  )
}

02

button-frosted-sizes

Example 02 · button-frosted-sizes

Frosted Sizes

The frosted Button in each stock size, extra small to large, each beside its matching square icon Button, over light rising from the bottom edge.

pnpm dlx shadcn add @01orbital/button-frosted-sizes
npx shadcn add @01orbital/button-frosted-sizes
yarn shadcn add @01orbital/button-frosted-sizes
bunx --bun shadcn add @01orbital/button-frosted-sizes
import { ArrowUpRightIcon } from "@phosphor-icons/react/dist/ssr"

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

export default function ButtonFrostedSizes() {
  return (
    <div className="dark relative isolate flex min-h-72 w-full flex-1 flex-col items-center justify-end gap-6 overflow-hidden bg-background p-10 pb-16 text-foreground sm:flex-row sm:items-end sm:justify-center">
      <div
        aria-hidden="true"
        className="absolute inset-0 -z-10 bg-[radial-gradient(60%_80%_at_50%_100%,oklch(0.72_0.09_255/0.55),transparent_70%)]"
      />
      <div className="flex items-start gap-2">
        <Button
          size="xs"
          type="button"
          className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
        >
          Extra small
        </Button>
        <Button
          size="icon-xs"
          type="button"
          aria-label="Open"
          className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
        >
          <ArrowUpRightIcon aria-hidden="true" />
        </Button>
      </div>
      <div className="flex items-start gap-2">
        <Button
          size="sm"
          type="button"
          className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
        >
          Small
        </Button>
        <Button
          size="icon-sm"
          type="button"
          aria-label="Open"
          className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
        >
          <ArrowUpRightIcon aria-hidden="true" />
        </Button>
      </div>
      <div className="flex items-start gap-2">
        <Button
          type="button"
          className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
        >
          Default
        </Button>
        <Button
          size="icon"
          type="button"
          aria-label="Open"
          className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
        >
          <ArrowUpRightIcon aria-hidden="true" />
        </Button>
      </div>
      <div className="flex items-start gap-2">
        <Button
          size="lg"
          type="button"
          className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
        >
          Large
        </Button>
        <Button
          size="icon-lg"
          type="button"
          aria-label="Open"
          className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
        >
          <ArrowUpRightIcon aria-hidden="true" />
        </Button>
      </div>
    </div>
  )
}

03

button-frosted-with-icon

Example 03 · button-frosted-with-icon

Frosted With Icon

A frosted Button with a play icon before its label, over light rising from the bottom edge.

pnpm dlx shadcn add @01orbital/button-frosted-with-icon
npx shadcn add @01orbital/button-frosted-with-icon
yarn shadcn add @01orbital/button-frosted-with-icon
bunx --bun shadcn add @01orbital/button-frosted-with-icon
import { PlayIcon } from "@phosphor-icons/react/dist/ssr"

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

export default function ButtonFrostedWithIcon() {
  return (
    <div className="dark relative isolate grid min-h-72 w-full flex-1 items-end justify-items-center overflow-hidden bg-background p-10 pb-16 text-foreground">
      <div
        aria-hidden="true"
        className="absolute inset-0 -z-10 bg-[radial-gradient(60%_80%_at_50%_100%,oklch(0.72_0.09_255/0.55),transparent_70%)]"
      />
      <Button
        size="lg"
        type="button"
        className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
      >
        <PlayIcon weight="fill" aria-hidden="true" />
        Watch the film
      </Button>
    </div>
  )
}

04

button-frosted-loading

Example 04 · button-frosted-loading

Frosted Loading

A disabled frosted Button with a spinner before its label, over a rising Moon Sphere.

pnpm dlx shadcn add @01orbital/button-frosted-loading
npx shadcn add @01orbital/button-frosted-loading
yarn shadcn add @01orbital/button-frosted-loading
bunx --bun shadcn add @01orbital/button-frosted-loading
import { MoonSphere } from "@/components/orbs/moon-sphere"
import { Button } from "@/components/ui/button"
import { Spinner } from "@/components/ui/spinner"

export default function ButtonFrostedLoading() {
  return (
    <div className="dark relative isolate grid min-h-72 w-full flex-1 place-items-center overflow-hidden bg-background p-10 text-foreground">
      <MoonSphere
        size={460}
        className="absolute top-[calc(50%-3.5rem)] left-1/2 -z-10 -translate-x-1/2"
      />
      <Button
        type="button"
        disabled
        className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
      >
        <Spinner aria-hidden="true" />
        Uploading
      </Button>
    </div>
  )
}

05

button-frosted-media-controls

Example 05 · button-frosted-media-controls

Frosted Media Controls

Frosted icon Buttons as a previous, pause and next media control row, the middle one larger.

pnpm dlx shadcn add @01orbital/button-frosted-media-controls
npx shadcn add @01orbital/button-frosted-media-controls
yarn shadcn add @01orbital/button-frosted-media-controls
bunx --bun shadcn add @01orbital/button-frosted-media-controls
import {
  PauseIcon,
  SkipBackIcon,
  SkipForwardIcon,
} from "@phosphor-icons/react/dist/ssr"

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

export default function ButtonFrostedMediaControls() {
  return (
    <div className="dark relative isolate flex min-h-72 w-full flex-1 items-end justify-center gap-4 overflow-hidden bg-background p-10 pb-16 text-foreground">
      <div
        aria-hidden="true"
        className="absolute inset-0 -z-10 bg-[radial-gradient(60%_80%_at_50%_100%,oklch(0.72_0.09_255/0.55),transparent_70%)]"
      />
      <Button
        size="icon"
        type="button"
        aria-label="Previous track"
        className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
      >
        <SkipBackIcon weight="fill" aria-hidden="true" />
      </Button>
      <Button
        size="icon-lg"
        type="button"
        aria-label="Pause"
        className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
      >
        <PauseIcon weight="fill" aria-hidden="true" />
      </Button>
      <Button
        size="icon"
        type="button"
        aria-label="Next track"
        className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
      >
        <SkipForwardIcon weight="fill" aria-hidden="true" />
      </Button>
    </div>
  )
}

06

button-frosted-pair

Example 06 · button-frosted-pair

Frosted Pair

A hero call to action over a rising Moon Sphere: a solid Button for the main action and a frosted one for the second.

pnpm dlx shadcn add @01orbital/button-frosted-pair
npx shadcn add @01orbital/button-frosted-pair
yarn shadcn add @01orbital/button-frosted-pair
bunx --bun shadcn add @01orbital/button-frosted-pair
import { MoonSphere } from "@/components/orbs/moon-sphere"
import { Button } from "@/components/ui/button"

export default function ButtonFrostedPair() {
  return (
    <section className="dark relative isolate flex min-h-96 w-full flex-1 flex-col items-center justify-center gap-6 overflow-hidden bg-background px-6 py-16 text-center text-foreground">
      <MoonSphere
        size={460}
        className="absolute top-[calc(50%+2.5rem)] left-1/2 -z-10 -translate-x-1/2"
      />
      <h2 className="max-w-lg text-4xl font-medium tracking-tight text-balance">
        Light that follows the room
      </h2>
      <p className="max-w-md text-foreground/80">
        Set a scene once and every lamp in the house keeps to it.
      </p>
      <div className="flex flex-wrap items-center justify-center gap-3">
        <Button size="lg" type="button">
          Get started
        </Button>
        <Button
          size="lg"
          type="button"
          className="relative border-current/25 bg-background/15 text-foreground shadow-md backdrop-blur-md after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:opacity-20 after:shadow-[inset_0_0_2px_1px_currentColor] hover:bg-background/25"
        >
          See the scenes
        </Button>
      </div>
    </section>
  )
}

07

button-menu

Example 07 · button-menu

Menu

An outline icon Button whose three lines fold into an X while its menu is open, driven by aria-expanded.

pnpm dlx shadcn add @01orbital/button-menu
npx shadcn add @01orbital/button-menu
yarn shadcn add @01orbital/button-menu
bunx --bun shadcn add @01orbital/button-menu
"use client"

import { useId, useState } from "react"

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

export default function ButtonMenu() {
  const [open, setOpen] = useState(false)
  const panelId = useId()
  return (
    <div className="relative">
      <Button
        size="icon"
        variant="outline"
        aria-expanded={open}
        aria-controls={panelId}
        aria-label={open ? "Close menu" : "Open menu"}
        onClick={() => setOpen((v) => !v)}
        className="group/menu-button"
      >
        {/* The three lines fold into an X while aria-expanded is true. */}
        <svg
          aria-hidden="true"
          fill="none"
          stroke="currentColor"
          strokeLinecap="round"
          strokeLinejoin="round"
          strokeWidth="2"
          viewBox="0 0 24 24"
        >
          <path
            className="origin-center -translate-y-1.75 transition-transform duration-300 ease-out group-aria-expanded/menu-button:translate-y-0 group-aria-expanded/menu-button:-rotate-45 motion-reduce:transition-none"
            d="M4 12L20 12"
          />
          <path
            className="origin-center transition-transform duration-300 ease-out group-aria-expanded/menu-button:rotate-45 motion-reduce:transition-none"
            d="M4 12H20"
          />
          <path
            className="origin-center translate-y-1.75 transition-transform duration-300 ease-out group-aria-expanded/menu-button:translate-y-0 group-aria-expanded/menu-button:-rotate-45 motion-reduce:transition-none"
            d="M4 12H20"
          />
        </svg>
      </Button>
      <nav
        id={panelId}
        hidden={!open}
        className="absolute top-full left-1/2 mt-2 min-w-48 -translate-x-1/2 rounded-3xl bg-popover p-1.5 text-popover-foreground shadow-lg ring-1 ring-foreground/5 dark:ring-foreground/10"
      >
        <ul>
          <li>
            <a
              href="#"
              className="flex rounded-2xl px-3 py-2 text-sm outline-none hover:bg-accent focus-visible:bg-accent"
            >
              Overview
            </a>
          </li>
          <li>
            <a
              href="#"
              className="flex rounded-2xl px-3 py-2 text-sm outline-none hover:bg-accent focus-visible:bg-accent"
            >
              Components
            </a>
          </li>
          <li>
            <a
              href="#"
              className="flex rounded-2xl px-3 py-2 text-sm outline-none hover:bg-accent focus-visible:bg-accent"
            >
              Pricing
            </a>
          </li>
          <li>
            <a
              href="#"
              className="flex rounded-2xl px-3 py-2 text-sm outline-none hover:bg-accent focus-visible:bg-accent"
            >
              Changelog
            </a>
          </li>
        </ul>
      </nav>
    </div>
  )
}

08

button-neoconstruct

Example 08 · button-neoconstruct

Neoconstruct

A Button in the Neoconstruct poster style: square, uppercase, a 3px border on poster red and a hard offset shadow it slides into when pressed. Brings the Neoconstruct theme with it.

pnpm dlx shadcn add @01orbital/button-neoconstruct
npx shadcn add @01orbital/button-neoconstruct
yarn shadcn add @01orbital/button-neoconstruct
bunx --bun shadcn add @01orbital/button-neoconstruct
import { ArrowRightIcon } from "@phosphor-icons/react/dist/ssr"

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

export default function ButtonNeoconstruct() {
  return (
    <Button
      data-theme="neoconstruct"
      variant={null}
      size={null}
      className="h-11 gap-2 rounded-(--radius-base) border-3 border-border bg-main px-6 font-heading text-sm font-normal tracking-wider text-main-foreground uppercase shadow-shadow ring-offset-white duration-100 hover:translate-x-boxShadowX hover:translate-y-boxShadowY hover:shadow-none focus-visible:border-border focus-visible:ring-2 focus-visible:ring-border focus-visible:ring-offset-2 active:not-aria-[haspopup]:translate-x-boxShadowX active:not-aria-[haspopup]:translate-y-boxShadowY active:not-aria-[haspopup]:shadow-none [&_svg]:size-4"
    >
      Get started
      <ArrowRightIcon aria-hidden="true" />
    </Button>
  )
}

09

button-letterpress

Example 09 · button-letterpress

Letterpress

Ink pressed into paper: a dark filled Button on cream paper, silver ink on black paper in dark mode.

pnpm dlx shadcn add @01orbital/button-letterpress
npx shadcn add @01orbital/button-letterpress
yarn shadcn add @01orbital/button-letterpress
bunx --bun shadcn add @01orbital/button-letterpress
import { Button } from "@/components/ui/button"

// Ink pressed into paper: a dark filled button on cream paper, silver on black in dark mode. The wrapper sets the paper's colors; the button reads them.
export default function ButtonLetterpress() {
  return (
    <div className="flex items-center justify-center rounded-md bg-(--stock-light) p-10 [--glint:oklch(1_0_0/0.8)] [--hair:oklch(0.300_0.021_83/0.2)] [--ink:oklch(0.300_0.021_83)] [--stock-light:oklch(0.944_0.021_89)] [--stock:oklch(0.911_0.026_87)] dark:[--glint:oklch(0.841_0.011_95/0.18)] dark:[--hair:oklch(0.841_0.011_95/0.22)] dark:[--ink:oklch(0.841_0.011_95)] dark:[--stock-light:oklch(0.159_0.008_96)] dark:[--stock:oklch(0.192_0.010_89)]">
      <Button
        variant={null}
        size={null}
        className="h-auto gap-1.5 rounded-sm border-transparent bg-(--ink) px-6 py-3 text-base text-(--stock-light) shadow-[inset_0_1px_0_color-mix(in_oklch,var(--stock-light)_12%,transparent),0_2px_5px_color-mix(in_oklch,var(--ink)_28%,transparent)] transition-[background-color,box-shadow,translate] hover:bg-[color-mix(in_oklch,var(--ink),var(--stock-light)_12%)] active:shadow-[inset_0_2px_3px_oklch(0_0_0/0.35)]"
      >
        Order prints
      </Button>
    </div>
  )
}

10

button-embossed

Example 10 · button-embossed

Embossed

The paper raised a hair, with the ink as the label: a Button on cream paper, black paper in dark mode.

pnpm dlx shadcn add @01orbital/button-embossed
npx shadcn add @01orbital/button-embossed
yarn shadcn add @01orbital/button-embossed
bunx --bun shadcn add @01orbital/button-embossed
import { Button } from "@/components/ui/button"

// The paper itself raised a hair, with the ink as the label: cream paper, black in dark mode. The wrapper sets the paper's colors; the button reads them.
export default function ButtonEmbossed() {
  return (
    <div className="flex items-center justify-center rounded-md bg-(--stock-light) p-10 [--glint:oklch(1_0_0/0.8)] [--hair:oklch(0.300_0.021_83/0.2)] [--ink:oklch(0.300_0.021_83)] [--stock-light:oklch(0.944_0.021_89)] [--stock:oklch(0.911_0.026_87)] dark:[--glint:oklch(0.841_0.011_95/0.18)] dark:[--hair:oklch(0.841_0.011_95/0.22)] dark:[--ink:oklch(0.841_0.011_95)] dark:[--stock-light:oklch(0.159_0.008_96)] dark:[--stock:oklch(0.192_0.010_89)]">
      <Button
        variant={null}
        size={null}
        className="h-auto gap-1.5 rounded-sm border-(--hair) bg-(--stock-light) px-6 py-3 text-base text-(--ink) shadow-[inset_0_1px_0_var(--glint),0_2px_5px_color-mix(in_oklch,var(--ink)_12%,transparent)] transition-[background-color,box-shadow,translate] hover:bg-(--stock) active:shadow-[inset_0_2px_3px_color-mix(in_oklch,var(--ink)_18%,transparent)]"
      >
        View the catalogue
      </Button>
    </div>
  )
}

11

button-gradient-border

Example 11 · button-gradient-border

Gradient Border

A dark pill Button with a 1px sky edge that fades at both ends, made from two backgrounds on a transparent border. Classes only.

pnpm dlx shadcn add @01orbital/button-gradient-border
npx shadcn add @01orbital/button-gradient-border
yarn shadcn add @01orbital/button-gradient-border
bunx --bun shadcn add @01orbital/button-gradient-border
import { Button } from "@/components/ui/button"

// A dark pill with a 1px sky edge that fades at both ends: the fill and the
// gradient are two backgrounds on a transparent border, one painted to the
// padding box and one to the border box.
export default function ButtonGradientBorder() {
  return (
    <Button className="h-8 rounded-full border border-transparent px-3.5 text-[13px] font-medium text-sky-300 [background:linear-gradient(#1e293b,#1e293b)_padding-box,linear-gradient(to_right,#38bdf84d,#38bdf8,#38bdf84d)_border-box] hover:text-sky-200 hover:[background:linear-gradient(#223352,#223352)_padding-box,linear-gradient(to_right,#38bdf84d,#38bdf8,#38bdf84d)_border-box]">
      Get started
    </Button>
  )
}

12

button-lit-border

Example 12 · button-lit-border

Lit Border

A glass pill Button whose indigo-to-cyan edge fades in on hover, drawn by a before: layer. Classes only.

pnpm dlx shadcn add @01orbital/button-lit-border
npx shadcn add @01orbital/button-lit-border
yarn shadcn add @01orbital/button-lit-border
bunx --bun shadcn add @01orbital/button-lit-border
import { Button } from "@/components/ui/button"

// A glass pill whose indigo-to-cyan edge fades in on hover. The edge is a
// before: layer under the label: a dark fill painted to its padding box and
// the gradient to its border box, faded with opacity.
export default function ButtonLitBorder() {
  return (
    <Button className="relative isolate h-auto rounded-full border border-white/10 bg-transparent bg-linear-to-t from-white/3 to-white/9 px-[18px] py-[9px] text-[13px]/[1.4] font-semibold text-slate-200 transition-colors duration-200 before:pointer-events-none before:absolute before:-inset-px before:-z-10 before:rounded-full before:border-[1.5px] before:border-transparent before:opacity-0 before:transition-opacity before:duration-250 before:[background:linear-gradient(#0f1a2e,#0f1a2e)_padding-box,linear-gradient(to_right,#818cf8,#22d3ee,#0ea5e9)_border-box] hover:bg-transparent hover:text-white hover:before:opacity-100">
      View on GitHub
    </Button>
  )
}

Button components

The library's own button components, each installed on its own.

01

sphere-button

Component 01 · sphere-button

Sphere Button

A round planetary button lit by a radial highlight and crescent inset shadows, in teal, blue and coral. A void variant opens a dark centre on hover; labels set in the display face. Open its docs page

pnpm dlx shadcn add @01orbital/sphere-button
npx shadcn add @01orbital/sphere-button
yarn shadcn add @01orbital/sphere-button
bunx --bun shadcn add @01orbital/sphere-button

The source comes with full access.

One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.

02

thermal-button

Component 02 · thermal-button

Thermal Button

A dark mono-label button built on motion that heats on hover, flashes to ember on press and greys to ash when a Thermal Provider reports depletion. Pulse respects reduced motion. Open its docs page

pnpm dlx shadcn add @01orbital/thermal-button
npx shadcn add @01orbital/thermal-button
yarn shadcn add @01orbital/thermal-button
bunx --bun shadcn add @01orbital/thermal-button

The source comes with full access.

One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.

Dependencies

npm: @base-ui/react, class-variance-authority, cn. The CLI installs them for you.

No other registry pieces.