121
GitHub
Actions

Button

Triggers primary, secondary, destructive, and quiet actions.

FrameworksAstro · React · Elements

Registry commandlumen add Button

InteractionNative markup

01

See it in context

Preview

02

Copy a working example

Usage

astro
---
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-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>
03

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.

bash@santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
pnpm add @santi020k/lumen-astro
bashAstro wrapper
lumen add Button
lumen add Button

API 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.

AttributeValuesDefaultDescription
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.
loadingbooleanfalseShows a spinner, sets aria-busy, and blocks pointer interaction while pending.
type"button" | "submit" | "reset""button"Sets the native button type.
class, classNamestring""Merges custom classes with the generated ui-* root classes.
...native attributesHTML attributes-Forwards standard attributes to the root element unless the component consumes them.