Forms

Button

Primary action trigger. 5 variants, 3 sizes, asChild.

Primitive

@radix-ui/react-slot

Variants

Five variants for different emphasis levels.

Sizes

Three sizes plus an icon-only variant.

With Icons

Icon slots on left and/or right side. Pass any SVG or icon component.

Loading State

Set loading=true to show a spinner and disable the button.

API Reference

PropTypeDefaultDescription
variant"primary" | "secondary" | "tertiary" | "destructive" | "ghost""primary"Visual style variant.
size"sm" | "md" | "lg" | "icon""md"Size preset.
asChildbooleanfalseRender as child element using Radix Slot.
loadingbooleanfalseShow spinner. Replaces iconLeft if present, otherwise overlays label.
iconLeftReactNode--Icon rendered before the label. Replaced by spinner when loading.
iconRightReactNode--Icon rendered after the label. Hidden when loading.
disabledbooleanfalseDisable the button. Also set automatically when loading.

Usage

import { Button } from "@doss/tetris-ui";