Button
Action control with variants, semantic colors, sizes, and a loading state.
When to use
Use Button when you need action control with variants, semantic colors, sizes, and a loading state.
Import
TypeScript
import { Button } from '@gzodo/ui'Use Button for commands. One primary button per view; outline, ghost, and text for everything else. Pass href to render a link with the same surface.
Examples
7Variants
variant picks the surface. primary is the main action. outline, ghost, and text are quieter. base uses the page background.Color and variant
Set
color and variant together. Color tints the surface; it does not replace the variant.Sizes
sm 22px, md 28px, lg 32px, xl 37px. Default is md.Loading
isLoading shows a spinner, sets aria-busy, and disables the control so the action cannot be submitted twice.Disabled
Disabled buttons do not fire click handlers and use the muted control opacity.
Link
A
href renders an anchor with the button surface. Disabled and loading links drop the href.Alignment
textAlignment is useful with fullWidth, when the label should sit left or right inside the button.Button
12Button
Property
Description
Type
Default
sizeFixed height of the control.
'sm' | 'md' | 'lg' | 'xl''md'variantSurface treatment. Primary is the main action.
'primary' | 'secondary' | 'outline' | 'ghost' | 'text' | 'base' | 'default'—
colorSemantic color layered on top of the variant.
'danger' | 'success' | 'warning'—
fullWidthStretch the control to the container width.
booleanfalsedisabledBlocks interaction and lowers opacity.
booleanfalseclassNameExtra classes, merged with the component classes.
string—
childrenLabel, icon, or both.
ReactNode—
isLoadingShows a spinner and disables the control.
booleanfalsetextAlignmentHorizontal alignment of the label.
'left' | 'center' | 'right''center'hrefRenders an anchor instead of a button.
string—
asCustom element or link component.
ElementType—
typeNative button type. Ignored when href is set.
'button' | 'submit' | 'reset''button'