Button
Button
A polymorphic button component with built-in loading states and keyboard support.
Usage
typescript
1import { Button } from '@flint-ui/core'23<Button variant="primary" size="md" onClick={handleClick}>4 Save Changes5</Button>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'primary' | 'secondary' | 'ghost' | 'primary' | Visual style |
| size | 'sm' | 'md' | 'lg' | 'md' | Button size |
| loading | boolean | false | Shows spinner, disables click |
| disabled | boolean | false | Disables interaction |
| asChild | boolean | false | Renders as child element |
Accessibility
Automatically handles aria-disabled, aria-busy (when loading), and keyboard focus management. Tab order follows DOM. Enter and Space trigger click.
<callout>All Flint UI components follow WAI-ARIA patterns. Keyboard navigation works out of the box.