Alert.
Messages with a clear purpose.
Live preview
import { Alert } from "luminescent";
import "luminescent/style.css";
export function Example() {
return (
<Alert severity="success" title="Changes saved">
Your workspace is up to date.
</Alert>
);
}
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 AlertProps from the package for the full inherited contract.
| Prop | Type | Details |
|---|---|---|
title | React.ReactNode | Optional unless marked required. |
severity | 'info' | 'success' | 'warning' | 'error' | Optional unless marked required. |
onClose | () => void | Optional unless marked required. |
closeLabel | string | Optional unless marked required. |
Accessibility and keyboard
Success/info use status; warning/error use alert. State is communicated through text and an icon, in addition to color.
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, Alert } from "luminescent";
import "luminescent/style.css";
export function Example() {
return (
<LuminescentProvider theme="light" accent="violet" glow="subtle">
<Alert severity="success" title="Changes saved">
Your workspace is up to date.
</Alert>
</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.