Alert
aqua/alertFreeComponent
Soft gradient notice panel in note, caution and stop flavors.
Live preview
live · rendered by the registry
Rendered by aqua on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://aqua.duca.dev/r/alert.jsonSource
1import * as React from "react"2import { cva, type VariantProps } from "class-variance-authority"34import { cn } from "@/lib/utils"56const alertVariants = cva(7 "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-[13px] shadow-[inset_0_1px_0_rgba(255,255,255,0.8),0_1px_3px_rgba(20,30,50,0.12)] has-[>svg]:grid-cols-[calc(var(--spacing)*5)_1fr] has-[>svg]:gap-x-3 [&>svg]:mt-0.5 [&>svg]:size-4",8 {9 variants: {10 variant: {11 default:12 "border-[#93a7c2] bg-[linear-gradient(180deg,#f4f9fe_0%,#e2eefb_100%)] text-[#2c3e55] [&>svg]:text-[#1c5fb8]",13 warning:14 "border-[#c2b06e] bg-[linear-gradient(180deg,#fffbe3_0%,#fdf3bc_100%)] text-[#5c4d1a] [&>svg]:text-[#8f7412]",15 destructive:16 "border-[#d9958d] bg-[linear-gradient(180deg,#fdf2f1_0%,#fadfdc_100%)] text-[#7a2a22] [&>svg]:text-[#a81f1f]",17 },18 },19 defaultVariants: {20 variant: "default",21 },22 }23)2425function Alert({26 className,27 variant,28 ...props29}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {30 return (31 <div32 data-slot="alert"33 role="alert"34 className={cn(alertVariants({ variant }), className)}35 {...props}36 />37 )38}3940function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {41 return (42 <div43 data-slot="alert-title"44 className={cn(45 "col-start-2 font-bold [text-shadow:0_1px_0_rgba(255,255,255,0.6)]",46 className47 )}48 {...props}49 />50 )51}5253function AlertDescription({54 className,55 ...props56}: React.ComponentProps<"div">) {57 return (58 <div59 data-slot="alert-description"60 className={cn("col-start-2 text-[12.5px] leading-relaxed", className)}61 {...props}62 />63 )64}6566export { Alert, AlertDescription, AlertTitle }
What it pulls in
npm packages
Files it writes
More from aqua
All 26 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Avataravatar | aqua | Components | Free | 1 dep | |
| Badgebadge | aqua | Components | Free | 2 deps | |
| Buttonbutton | aqua | Components | Free | 2 deps | |
| Chat Bubblechat-bubble | aqua | Components | Free | no deps | |
| Checkboxcheckbox | aqua | Components | Free | 2 deps | |
| Code Blockcode-block | aqua | Components | Free | 2 deps · 2 files | |
| Cursorcursor | aqua | Components | Free | no deps | |
| Dialogdialog | aqua | Components | Free | 1 dep |
