Tac UIv1.1.2

Button

A highly interactive element used to trigger actions, supporting multiple modern visual variants, sizes, and micro-animations.

Import

tsx
import { Button } from '@tac-ui/web';

Playground

Interactively configure the Button props below.

tsx
<Button variant="primary" size="md">Button</Button>

Variants

Buttons come in several refined variants to establish clear visual hierarchy in the UI.

tsx
<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="point">Point</Button>
<Button variant="destructive">Destructive</Button>

Sizes

Buttons support three responsive sizes to fit various layouts.

tsx
<Button size="sm">Small</Button>
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>

With Icons

Enhance button context with leading or trailing icons.

tsx
import { Rocket, Send } from '@tac-ui/icon';

<Button leftIcon={<Rocket />}>Get Started</Button>
<Button variant="outline" rightIcon={<Send />}>Submit</Button>
<Button variant="secondary" iconOnly><Rocket /></Button>

Disabled

Disabled buttons are reduced in opacity and non-interactive.

tsx
<Button disabled>Disabled Primary</Button>
<Button variant="outline" disabled>Disabled Outline</Button>

API Reference

PropTypeDefaultDescription
variant"primary" | "secondary" | "outline" | "ghost" | "point" | "destructive""primary"Visual style variant of the button.
size"sm" | "md" | "lg""md"Size of the button.
leftIconReact.ReactNode-Icon rendered to the left of the button label.
rightIconReact.ReactNode-Icon rendered to the right of the button label.
iconOnlybooleanfalseRemoves padding to properly center a single icon.
tiltbooleanfalseWhen true, applies a cursor-tracking 3D micro-tilt on hover.
disabledbooleanfalseDisables the button when true.
classNamestring-Additional CSS class names.