Button

A multi-variant action component with loading state and size variants.

Use Button for primary actions, inline confirmations, and lightweight toolbar interactions.

Preview

Button variants

The primary button styles cover high-emphasis actions, secondary actions, and quiet inline controls.

Registry install

pnpm dlx shadcn@latest add https://react.tileui.zmorg.cn/r/button.json

Package usage

import { Button } from '@tile-ui/react';
 
export function SaveChanges() {
	return <Button>Save changes</Button>;
}

Highlights

  • Six visual variants
  • Loading state support
  • Small, default, large, and icon sizes
  • asChild support for router links and custom wrappers

Registry dependencies

ItemPurpose
buttonComponent source
stylesShared SCSS tokens and globals

API reference

PropTypeDefaultNotes
variantdefault | destructive | outline | secondary | ghost | linkdefaultChooses the button visual treatment.
sizedefault | sm | lg | icondefaultControls height and padding.
loadingbooleanfalseDisables interaction and shows the inline spinner.
asChildbooleanfalseRenders via Radix Slot for composition.