Button

A chunky pressable block. It lifts on hover and sinks into its own wall when pressed.

View as Markdown

Installation

npx shadcn@latest add @cozy/button

Usage

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

<Button variant="reward">Claim reward</Button>

Examples

States

Rest, hover, pressed, keyboard focus and disabled. Disabled turns flat and dashed, so it reads without colour.

Rest
Hover
Pressed
Focus
Disabled

Sizes

With a glyph

Loading

loading shows a spinner, sets aria-busy and blocks clicks.

API

Everything else is passed through to the underlying element or Radix primitive.

PropTypeDefaultDescription
variant"default" | "secondary" | "success" | "reward" | "outline" | "ghost" | "destructive""default"Face and wall colours, from the active palette.
size"default" | "sm" | "lg" | "icon" | "icon-sm""default"Every size keeps a 44 px touch target or more.
loadingbooleanfalseSpinner, aria-busy, disabled while true.
asChildbooleanfalseRender the child element (for example a link) with button styling.