Components
Button
A multi-variant action component with loading state and size variants.
Use Button for primary actions, inline confirmations, and lightweight toolbar interactions.
import { Button } from '@tile-ui/react';
export default function ButtonDemo() {
return (
<div className="component-preview__stack">
<div className="button-group">Registry install
pnpm dlx shadcn@latest add @tile-ui/buttonPackage usage
import { Button } from '@tile-ui/react';
export function SaveChanges() {
return <Button>Save changes</Button>;
}Use the variant prop to change the visual treatment:
<Button variant="outline">Outline</Button>
<Button variant="destructive">Delete</Button>Use the loading prop to disable interaction and show the inline spinner:
<Button loading>Submitting...</Button>Highlights
- Six visual variants
- Loading state support
- Eight sizes from
xsthroughicon-lg asChildsupport for router links and custom wrappers
Registry dependencies
| Item | Purpose |
|---|---|
button | Component source and module styles |
core | Framework-agnostic logic helpers |
utils | Shared utility helpers |
styles | Shared SCSS tokens and globals |
API reference
Button
The Button component wraps the native button element and extends React.ButtonHTMLAttributes<HTMLButtonElement>.
| Prop | Type | Default | Notes |
|---|---|---|---|
variant | default | destructive | outline | secondary | ghost | link | default | Chooses the button visual treatment. |
size | default | xs | sm | lg | icon | icon-xs | icon-sm | icon-lg | default | Controls height and padding. |
loading | boolean | false | Disables interaction and shows the inline spinner. |
asChild | boolean | false | Renders via Radix Slot for composition. |