A new version is available
Payment received
Your trial ends in 3 days
Deploy failed
Playground
Change the props and copy the code. The controls come from the component's TypeScript types.
Trial ends soon
Props
import { Alert } from "@/components/ui/alert";<Alert title="Trial ends soon">Upgrade to keep your projects after the 14th.</Alert>Installation
$ pnpm dlx shadcn@latest add @synccn/alertFirst time in this project? Connect synccn with one command.
Usage
import { Alert } from "@/components/ui/alert";<Alert variant="warning" title="Trial ends soon">…</Alert>API reference
Generated from the component's TypeScript types, so it always matches the code.
- variant
"default" | "info" | "success" | "warning" | "destructive"Default
"default"Colour and default icon.
- title
React.ReactNodeBold first line.
- dismissible
booleanDefault
falseShows a close button that hides the alert.
- action
React.ReactNodeButton or link shown under the text.
- icon
React.ElementTypeReplaces the variant's default icon.
- children
React.ReactNodeContent to render.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Helpers
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for CheckCircle2, Info, TriangleAlert, X, XCircle
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA roles: variant
- ARIA attributes: aria-label