Button
The control everything else is measured against — seven variants, four sizes, rings instead of borders.
Button is 32px tall by default and draws its edge with a ring, not a
border — so a variant change never shifts the layout by a pixel and buttons sit
flush inside a group.
primary is the inverse of the page: black on light, white on dark. There is
no coloured accent anywhere in the system, which leaves hue free to mean
exactly one thing — status.
Usage
Variants
destructive is a filled red button and belongs in the footer of a dialog that
is about deleting. destructive-secondary is the row-level version — the one
that opens that dialog.
Sizes
20, 26, 32 and 40px. base is the default and the height every other control
in the library shares.
Icons
icon and iconEnd accept a component, an element, or any node — heyo-ui
ships no icon dependency. The control sizes the glyph; never do it yourself.
Shapes
square is an icon-only button — give it an aria-label. block fills its
container, which is what a form's submit button usually wants.
Loading and disabled
loading swaps the leading icon for a spinner and blocks interaction, so the
label stays put and the button keeps its width.
As a link
render swaps the element while keeping every bit of styling — the way to turn
a button into an anchor or a router link.
ButtonGroup
Welds buttons into a single control: shared edges collapse, only the outer corners stay rounded, and the hovered or focused button floats above its neighbours so its ring is never clipped.
ButtonGroup welds actions together. For a set that remembers which one is
selected, use ToggleGroup instead.
Properties
The visual weight. It defaults to secondary.
20, 26, 32 or 40px tall. It defaults to base.
square is icon-only, block fills the container. It defaults to
default.
Rendered before the label — or as the only content when
shape="square".
Rendered after the label.
Swaps the leading icon for a spinner and blocks interaction.
The native disabled state.
Renders a different element with the same styling — an <a>, a router
link.
Merged through tailwind-merge, so rounded-full px-6 is a pill.
ButtonGroup
Stacks the buttons instead of placing them side by side. It defaults to
horizontal.
buttonVariants
The cva definition behind the component, exported for the rare case where
something that is not a button has to look exactly like one.