Inline messages for status and feedback, with a neutral surface, a colored icon and a dismiss that collapses smoothly.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
npm packages it adds
- cn
- @base-ui/react
- @tabler/icons-react
- class-variance-authority
Code
import { IconCircleX, IconTerminal2 } from "@tabler/icons-react"
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
export function AlertDemo() {
return (
<div className="flex w-full max-w-lg flex-col gap-3">
<Alert>
<IconTerminal2 />
<AlertTitle>Heads up</AlertTitle>
<AlertDescription>
You can add components to your app using the CLI.
</AlertDescription>
</Alert>
<Alert variant="destructive">
<IconCircleX />
<AlertTitle>Payment failed</AlertTitle>
<AlertDescription>
Your card was declined. Update your billing details.
</AlertDescription>
</Alert>
</div>
)
}
































