Documentation
Data display
Badge
Labels status, type, plan, or count information.
01
See it in context
Preview
Pro planAstroBetaDeployedReview neededBuild failed
02
Copy a working example
Usage
---
import { Badge } from '@santi020k/lumen-astro'
---
<div style="display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;">
<Badge>Pro plan</Badge>
<Badge variant="secondary">Astro</Badge>
<Badge variant="outline">Beta</Badge>
<Badge variant="success">Deployed</Badge>
<Badge variant="warning">Review needed</Badge>
<Badge variant="destructive">Build failed</Badge>
</div>---
import { Badge } from '@santi020k/lumen-astro'
---
<div style="display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;">
<Badge>Pro plan</Badge>
<Badge variant="secondary">Astro</Badge>
<Badge variant="outline">Beta</Badge>
<Badge variant="success">Deployed</Badge>
<Badge variant="warning">Review needed</Badge>
<Badge variant="destructive">Build failed</Badge>
</div>import { Badge } from '@santi020k/lumen-react'
export const Example = () => (
<>
<div style={{ display: 'flex', gap: '0.5rem', flexWrap: 'wrap', alignItems: 'center' }}>
<Badge>Pro plan</Badge>
<Badge variant="secondary">Astro</Badge>
<Badge variant="outline">Beta</Badge>
<Badge variant="success">Deployed</Badge>
<Badge variant="warning">Review needed</Badge>
<Badge variant="destructive">Build failed</Badge>
</div>
</>
)import { Badge } from '@santi020k/lumen-react'
export const Example = () => (
<>
<div style={{ display: 'flex', gap: '0.5rem', flexWrap: 'wrap', alignItems: 'center' }}>
<Badge>Pro plan</Badge>
<Badge variant="secondary">Astro</Badge>
<Badge variant="outline">Beta</Badge>
<Badge variant="success">Deployed</Badge>
<Badge variant="warning">Review needed</Badge>
<Badge variant="destructive">Build failed</Badge>
</div>
</>
)<script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<div style="display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;">
<lumen-badge>Pro plan</lumen-badge>
<lumen-badge variant="secondary">Astro</lumen-badge>
<lumen-badge variant="outline">Beta</lumen-badge>
<lumen-badge variant="success">Deployed</lumen-badge>
<lumen-badge variant="warning">Review needed</lumen-badge>
<lumen-badge variant="destructive">Build failed</lumen-badge>
</div><script type="module">
import { defineLumenElements } from '@santi020k/lumen-elements/define'
defineLumenElements()
</script>
<div style="display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;">
<lumen-badge>Pro plan</lumen-badge>
<lumen-badge variant="secondary">Astro</lumen-badge>
<lumen-badge variant="outline">Beta</lumen-badge>
<lumen-badge variant="success">Deployed</lumen-badge>
<lumen-badge variant="warning">Review needed</lumen-badge>
<lumen-badge variant="destructive">Build failed</lumen-badge>
</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.
pnpm add @santi020k/lumen-astropnpm add @santi020k/lumen-astrolumen add Badgelumen add Badgepnpm add @santi020k/lumen-reactpnpm add @santi020k/lumen-reactlumen add Badge --target reactlumen add Badge --target reactpnpm add @santi020k/lumen-elementspnpm add @santi020k/lumen-elementslumen add Badge --target elementslumen add Badge --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" | "destructive" | "success" | "warning" | "default" | Controls the badge tone. |
| 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. |