4.2.0
Core

Button

An action a reader takes, not a label they read — if it only names something that is a `Badge`, and if it navigates, compose it with `asChild`.

Default

The one import a consumer needs. Never copy the component — import it.

Usage

import { Button } from '@oceanic-hub/brand-system'

One primary action per surface. secondary keeps the brand accent at lower weight; outline carries no brand fill at rest; it washes to accent-tint on hover, which is the accent at its lowest weight. ghost is for actions inside a dense row; link is for an action that reads as prose, not a control.

There is no loading VARIANT, and there is now a busy STATE (@OCE-2248) — the difference is the whole design. A variant would be a seventh appearance to pick between; a state layers over all six without exception, disabling the control, reporting aria-busy and adding a spinner that JOINS the label instead of replacing it, because the sentence is what says which action is under way. busy={false} renders the spinner's slot already, so entering busy costs no width and nothing beside the button moves — and a button that never declares busy renders no slot and keeps its exact former width. The anti-flicker floor that stops a fast response from strobing is the host's clock, not this package's.

The size scale is sm / md / lg, plus a square form of each. icon-sm and icon-lg are the squares of their text rows; icon is 36px and matches none — it predates the axis and is left alone rather than repainted (@OCE-1755). Upstream's xs/icon-xs are refused: 24px, below the 32px floor every control on this scale is held to.

asChild changes the ELEMENT, not the appearance — it is how this button becomes a real anchor, and it is orthogonal to variant. A pill shape (rounded-full) is on the radius scale for circles, avatars and badges, not for a CTA; this button stays on the 6px step like every other rectangular surface. For more than one button read as a set, reach for ButtonGroup.

Tailwind v4 dropped the default pointer cursor from buttons; this component still sets cursor-pointer, so a button reads as clickable again.

Outline

No brand fill at rest — it washes to accent-tint on hover, which is the accent at its lowest weight. For an action beside the primary one that should read as plain chrome, not as a lower-weight version of the CTA.

Secondary

The brand accent without the fill — same identity as the primary action, lower weight. Reach for it when the action is a real alternative to the primary one, not merely adjacent chrome (that is outline).

Ghost

No border and no fill until hover — for an action inside a dense row, a table or a toolbar, where full button chrome would compete with the content next to it.

Destructive

An outlined red border with the label in ink, never a red fill — the copy carries the severity (core-layer.md), so the label says exactly what will happen: "Delete 12 contacts permanently", not "Delete".

For an action that reads as prose inside a sentence or a list — no border, no background, an underline on hover. This is not navigation on its own: for an actual link, compose it with asChild.

Sizes

sm is the table-row size; icon is square and takes an icon child only.

Square sizes

icon-sm and icon-lg are the square forms of sm and lg — 32px and 48px. Each row pairs the square with the text button whose height it matches, which is what the axis is for. icon is the odd one out at 36px and matches no text size.

With an icon

The icon is a plain child — gap-2 on every size already spaces it from the label, so no data-icon attribute or slot is needed the way Base UI's generation wants one.

The styles stay, the element changes — this is how a button becomes a real link.

States

disabled says the action is unavailable; busy says it is under way. Two different sentences, so they wear different treatments — a disabled button fades to 40% and refuses the pointer, a busy one keeps its full ink and refuses the click, because the spinner is already the signal and a faded spinner is a worse one.

Busy

A mutating action shows that it is working: the button disables instantly, aria-busy goes up, and a spinner JOINS the label rather than replacing it — a mark alone says something is happening without saying what. Flip the switch and watch the row: nothing moves. busy={false} already renders the spinner's slot, so the space is bought at rest by the caller who declares the button can go busy, and no button written before this prop existed pays for it. A square size has no label to join, so there the spinner takes the mark's place instead.

API Reference

See the Button API page for every prop of every part, with types, defaults and the contract that pins them. It also documents buttonVariants — exported alongside the parts, and signatures rather than props.

On this page