Button
Clickable action with variants, sizes, loading state, icon slots, and asChild.
At a glance
- Variants:
primary,secondary,ghost,destructive - Sizes:
sm,md,lg - States: default, pressed, disabled, loading
- Composition:
asChildrenders a supplied element (e.g.<Link>) as the interactive root.
Web preview
Variants
Native preview (Expo Snack)
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'primary' | 'secondary' | 'ghost' | 'destructive' | 'primary' | Visual intent |
size | 'sm' | 'md' | 'lg' | 'md' | Control height + text size |
loading | boolean | false | Replaces leading icon with Spinner; blocks press |
disabled | boolean | false | Visually muted + non-interactive |
leadingIcon / trailingIcon | ComponentType<{ size?: number; color?: string }> | — | Icon component reference |
asChild | boolean | false | Renders the single child as the interactive root |