Measured entry
shadcn-alert
A small React alert primitive shipped as TypeScript source, with separate container, title, and description exports plus default and destructive variants. It depends on class-variance-authority, a local cn helper, and the Tailwind theme utilities used by the shadcn styling system.



Measured
Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.
| Build | OK |
|---|---|
| Mount | OK |
| Console errors | 0 |
| Uncaught page errors | 0 |
| Horizontal overflow | clean at 375, 768, 1440 |
| Axe critical | 0 |
| Axe serious | 0 |
| Axe moderate | 0 |
| Axe minor | 0 |
| Gzip marginal | 12.5 KB (77.1 KB build, 64.6 KB baseline) |
| Bare mode | FAIL |
| Provider required | NO |
| Demo used | written from the component source API |
What the harness recorded
BARE BUILD
✗ Build failed in 926ms error during build: [vite]: Rollup failed to resolve import "class-variance-authority" from "<sandbox>/src/cut/components/ui/alert.tsx".
Verdict
A solid, focused alert primitive for an existing shadcn codebase. It builds, mounts, and adapts cleanly in the prepared harness, but it needs a shadcn-style setup and does not work as a bare copy because its variant helper and local styling utilities are assumed.
Use it if
- You need an inline status or error notice with a built-in alert role.
- Your app already uses shadcn conventions and Tailwind theme tokens.
- You want source-owned markup that can accept custom classes and optional icons.
Skip it if
- You need dismiss, action, timeout, or toast behavior without building it yourself.
- Your project does not use Tailwind utilities or shadcn theme tokens.
- You want a dependency-free component that can be copied into a bare React app.
Install
| Declared dependencies | none declared |
|---|---|
| Missing on install | none |
| Bare install | fails once the shadcn-style helpers are removed, so it needs that setup |
| Provider | no provider required in the harness |
In a non-shadcn project, add class-variance-authority, provide the cn class-merging helper and its import alias, configure Tailwind to scan the component, and define the card, foreground, destructive, border, and muted theme utilities it references.
Source and credit
This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.
Author repository
github.com/shadcn-ui/uiAlternatives
Other published entries for the alert pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.
- 8bitcn-toastskeuomorphism
- Renders
- YES
- A11y
- 0
- Gzip
- 30.8KB
- Bare
- pass
- Prov
- NO
- neobrutalism-sonnerbrutalism
- Renders
- YES
- A11y
- 0
- Gzip
- 31.6KB
- Bare
- pass
- Prov
- NO
- reui-alertminimal-flat
- Renders
- YES
- A11y
- 0
- Gzip
- 29.9KB
- Bare
- fail
- Prov
- NO
- neobrutalism-alertbrutalism
- Renders
- YES
- A11y
- 0
- Gzip
- 30.0KB
- Bare
- fail
- Prov
- NO
- shadcn-sonnerunclassified
- Renders
- YES
- A11y
- 0
- Gzip
- 31.9KB
- Bare
- fail
- Prov
- NO
- hextaui-sonnerminimal-flat
- Renders
- YES
- A11y
- 0
- Gzip
- 32.1KB
- Bare
- fail
- Prov
- NO