Actions
Button
Triggers primary, secondary, destructive, and quiet actions.
01
See it and copy it
Framework example
Choose Astro, React, or Elements to compare native usage against the shared visual output. Each example assumes the framework-level setup is already complete.
Framework usage
Switch targets to compare the adapter code. The preview stays visually stable because all three packages share the same tokens andui-* class contract.---
import { Button, Icon } from '@santi020k/lumen-astro'
---
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;">
<Button>Default</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="destructive">Destructive</Button>
<Button variant="link">Link</Button>
</div>
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;">
<Button size="sm">Small</Button>
<Button>Default size</Button>
<Button size="lg">Large</Button>
<Button aria-label="Settings" size="icon"><Icon name="settings" decorative /></Button>
</div>
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;">
<Button loading>Saving</Button>
<Button disabled>Disabled</Button>
</div>import { Button, Icon } from '@santi020k/lumen-react'
export const Example = () => (
<>
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem', alignItems: 'center' }}>
<Button>Default</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="destructive">Destructive</Button>
<Button variant="link">Link</Button>
</div>
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem', alignItems: 'center' }}>
<Button size="sm">Small</Button>
<Button>Default size</Button>
<Button size="lg">Large</Button>
<Button aria-label="Settings" size="icon"><Icon name="settings" decorative /></Button>
</div>
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem', alignItems: 'center' }}>
<Button loading>Saving</Button>
<Button disabled>Disabled</Button>
</div>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;">
<lumen-button>Default</lumen-button>
<lumen-button variant="secondary">Secondary</lumen-button>
<lumen-button variant="outline">Outline</lumen-button>
<lumen-button variant="ghost">Ghost</lumen-button>
<lumen-button variant="destructive">Destructive</lumen-button>
<lumen-button variant="link">Link</lumen-button>
</div>
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;">
<lumen-button size="sm">Small</lumen-button>
<lumen-button>Default size</lumen-button>
<lumen-button size="lg">Large</lumen-button>
<lumen-button aria-label="Settings" size="icon"><lumen-icon name="settings" decorative></lumen-icon></lumen-button>
</div>
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;">
<lumen-button loading>Saving</lumen-button>
<lumen-button disabled>Disabled</lumen-button>
</div>02
Choose your target
Add this component
Choose the package for your runtime. All adapters share the Lumen stylesheet. Use the matching registry command when you want a local wrapper for that framework.
pnpm add @santi020k/lumen-astropnpm add @santi020k/lumen-astrolumen add Buttonlumen add Buttonpnpm add @santi020k/lumen-reactpnpm add @santi020k/lumen-reactlumen add Button --target reactlumen add Button --target reactpnpm add @santi020k/lumen-elementspnpm add @santi020k/lumen-elementslumen add Button --target elementslumen add Button --target elementsAPI reference
Lumen-specific props and runtime attributes for the Astro primitive. React props follow the same names; Elements use equivalent kebab-case attributes where custom elements expose them.
| Attribute | Values | Default | Description |
|---|---|---|---|
| variant | "default" | "secondary" | "outline" | "ghost" | "link" | "destructive" | "default" | Controls the button emphasis. |
| size | "default" | "sm" | "lg" | "icon" | "default" | Controls button height, padding, and icon-only sizing. |
| loading | boolean | false | Shows a spinner, sets aria-busy, and blocks pointer interaction while pending. |
| type | "button" | "submit" | "reset" | "button" | Sets the native button type. |
| class, className | string | "" | Merges custom classes with the generated ui-* root classes. |
| ...native attributes | HTML attributes | - | Forwards standard attributes to the root element unless the component consumes them. |