Alert
Inline alert surface for success, warning, and destructive messaging.
Heads up
This is a default alert.
Error
Something went wrong.
Success
Your changes have been saved.
Warning
Please review before continuing.
Note
This is an informational message.
Installation
npx shadcn@latest add @gameone/alertRegistry dependencies: gameone-utils
Usage
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"<Alert>
<AlertTitle>Heads up</AlertTitle>
<AlertDescription>
Important information goes here.
</AlertDescription>
</Alert>Examples
Default
Heads up
This is a default alert.
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
export function AlertDefault() {
return (
<Alert>
<AlertTitle>Heads up</AlertTitle>
<AlertDescription>This is a default alert.</AlertDescription>
</Alert>
)
}Destructive
Error
Something went wrong.
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
export function AlertDestructive() {
return (
<Alert variant="destructive">
<AlertTitle>Error</AlertTitle>
<AlertDescription>Something went wrong.</AlertDescription>
</Alert>
)
}Success
Success
Your changes have been saved.
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
export function AlertSuccess() {
return (
<Alert variant="success">
<AlertTitle>Success</AlertTitle>
<AlertDescription>Your changes have been saved.</AlertDescription>
</Alert>
)
}Warning
Warning
Please review before continuing.
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
export function AlertWarning() {
return (
<Alert variant="warning">
<AlertTitle>Warning</AlertTitle>
<AlertDescription>Please review before continuing.</AlertDescription>
</Alert>
)
}Info
Note
This is an informational message.
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
export function AlertInfo() {
return (
<Alert variant="info">
<AlertTitle>Note</AlertTitle>
<AlertDescription>This is an informational message.</AlertDescription>
</Alert>
)
}