Components
Alert
A status or error message with an optional icon, title and description.
Ombelle · light
Messages
Preset saved
New components in this project now use your preset.
Install blocked
button.tsx was edited locally. Review the change before replacing it.
Saved
Your changes are ready.
Review needed
Two items need your attention.
New version
A component update is available.
One seat left on the Team plan.
UpgradeInstallation
Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.
pnpm dlx @ombelle-ui/cli@1.1.2 add alertAdds components/ui/alert.tsx and installs react, clsx, tailwind-merge, lucide-react with lifecycle scripts disabled.
In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.
Usage
example.tsx
import { Alert, AlertTitle, AlertDescription } from '@/components/ui/alert'
export function SaveStatus() {
return (
<Alert>
<AlertTitle>Preset saved</AlertTitle>
<AlertDescription>New components now install with this preset.</AlertDescription>
</Alert>
)
}
export function Intents() {
return (
<>
<Alert variant="success"><AlertTitle>Saved</AlertTitle><AlertDescription>Your changes are ready.</AlertDescription></Alert>
<Alert variant="warning"><AlertTitle>Review needed</AlertTitle><AlertDescription>Two items need your attention.</AlertDescription></Alert>
<Alert variant="info"><AlertTitle>New version</AlertTitle><AlertDescription>A component update is available.</AlertDescription></Alert>
</>
)
}API and states
- API
- variant (default, destructive, success, warning, info), layout (default, compact), onDismiss, dismissLabel, AlertTitle, AlertDescription, AlertActions, AlertDismiss
- Minimum states
- Default, success, warning and info (role status); destructive (role alert); dismissible; compact
- Native basis
- <div> with a live-region role
- Styles
- Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.