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/button

Package 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 xs through icon-lg
  • asChild support for router links and custom wrappers

Registry dependencies

ItemPurpose
buttonComponent source and module styles
coreFramework-agnostic logic helpers
utilsShared utility helpers
stylesShared SCSS tokens and globals

API reference

Button

The Button component wraps the native button element and extends React.ButtonHTMLAttributes<HTMLButtonElement>.

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