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.
View Button code
Framework usage
Switch targets to compare the adapter code. This live preview runs the Astro example. React and Elements use their own behavior APIs; complete the matching framework setup before copying an example.---
import { Button, Icon, Stack } from '@santi020k/lumen-astro'
---
<Stack align="center" direction="horizontal" gap="sm" wrap>
<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>
</Stack>
<Stack align="center" direction="horizontal" gap="sm" wrap>
<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>
</Stack>
<Stack align="center" direction="horizontal" gap="sm" wrap>
<Button loading>Saving</Button>
<Button disabled>Disabled</Button>
</Stack>import { Button, Icon, Stack } from '@santi020k/lumen-react'
export const Example = () => (
<>
<Stack align="center" direction="horizontal" gap="sm" wrap>
<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>
</Stack>
<Stack align="center" direction="horizontal" gap="sm" wrap>
<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>
</Stack>
<Stack align="center" direction="horizontal" gap="sm" wrap>
<Button loading>Saving</Button>
<Button disabled>Disabled</Button>
</Stack>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<lumen-stack align="center" direction="horizontal" gap="sm" wrap>
<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>
</lumen-stack>
<lumen-stack align="center" direction="horizontal" gap="sm" wrap>
<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>
</lumen-stack>
<lumen-stack align="center" direction="horizontal" gap="sm" wrap>
<lumen-button loading>Saving</lumen-button>
<lumen-button disabled>Disabled</lumen-button>
</lumen-stack>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. Use the framework differences above and the copyable examples for React composition and Elements attributes; the public adapter types define their supported contracts.
| 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. |