Badge.
Status that can be read at a glance.
Live preview
import { Badge } from "luminescent";
import "luminescent/style.css";
export function Example() {
return (
<Badge variant="success" dot>
Published
</Badge>
);
}
Installation
npm install luminescent
Import luminescent/style.css once at your application root. The example above uses the same package implementation as Storybook.
Variants and states
Use the preview controls to explore the supported variants, sizes, disabled/loading states and reduced motion. Controls appear only where the component exposes the corresponding prop. Theme and glow apply to every component.
API reference
Generated from the source TypeScript interfaces. Native attributes, className, style, aria-* and data-* also pass through to the documented element. Import BadgeProps from the package for the full inherited contract.
| Prop | Type | Details |
|---|---|---|
variant | 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info' | Optional unless marked required. |
size | 'sm' | 'md' | Optional unless marked required. |
dot | boolean | Optional unless marked required. |
Accessibility and keyboard
Visible text communicates status; the optional dot is decorative. Static badges do not announce updates automatically. Use a parent live region only for meaningful live changes.
Keep labels meaningful and test application-level contrast, focus order and screen-reader output. See the accessibility guide for composition requirements.
Theme customization
import { LuminescentProvider, Badge } from "luminescent";
import "luminescent/style.css";
export function Example() {
return (
<LuminescentProvider theme="light" accent="violet" glow="subtle">
<Badge variant="success" dot>
Published
</Badge>
</LuminescentProvider>
);
}
Switch between light and dark in the preview, or open the playground for a larger workspace. Custom CSS variables can override spacing, color, typography and effects.