Alert
cinatra-ai/alertFreeComponent
Cinatra design-system alert / callout.
Live preview
live · rendered by the registry
Rendered by @cinatra-ai on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/cinatra-ai/cinatra/main/public/r/alert.jsonSource
1"use client"23import * as React from 'react'4import { cva, type VariantProps } from 'class-variance-authority'5import { cn } from '@/lib/utils'67const alertVariants = cva(8 'relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current',9 {10 variants: {11 variant: {12 default: 'bg-card text-card-foreground',13 destructive:14 'bg-destructive/10 text-destructive border-destructive/30 [&>svg]:text-destructive *:data-[slot=alert-description]:text-destructive/90',15 warning:16 'bg-warning/10 text-warning border-warning/30 [&>svg]:text-warning *:data-[slot=alert-description]:text-warning/90',17 success:18 'bg-success/10 text-success border-success/30 [&>svg]:text-success *:data-[slot=alert-description]:text-success/90',19 info:20 'bg-info/10 text-info border-info/30 [&>svg]:text-info *:data-[slot=alert-description]:text-info/90',21 },22 },23 defaultVariants: {24 variant: 'default',25 },26 }27)2829function Alert({30 className,31 variant,32 ...props33}: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>) {34 return (35 <div36 data-slot='alert'37 role='alert'38 className={cn(alertVariants({ variant }), className)}39 {...props}40 />41 )42}4344function AlertTitle({ className, ...props }: React.ComponentProps<'div'>) {45 return (46 <div47 data-slot='alert-title'48 className={cn(49 'col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight',50 className51 )}52 {...props}53 />54 )55}5657function AlertDescription({58 className,59 ...props60}: React.ComponentProps<'div'>) {61 return (62 <div63 data-slot='alert-description'64 className={cn(65 'col-start-2 text-sm leading-[1.55] text-pretty text-muted-foreground [&>p+p]:mt-1.5',66 className67 )}68 {...props}69 />70 )71}7273export { Alert, AlertTitle, AlertDescription }
What it pulls in
npm packages
Other registry items
Files it writes
More from @cinatra-ai
All 14 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Badgebadge | @cinatra-ai | Components | Free | 2 deps | |
| Buttonbutton | @cinatra-ai | Components | Free | 2 deps | |
| Cardcard | @cinatra-ai | Components | Free | no deps | |
| Fieldfield | @cinatra-ai | Components | Free | 1 dep | |
| Inputinput | @cinatra-ai | Components | Free | no deps | |
| Input Groupinput-group | @cinatra-ai | Components | Free | 1 dep | |
| Labellabel | @cinatra-ai | Components | Free | 1 dep | |
| Paginated Tablepaginated-table | @cinatra-ai | Components | Free | no deps |
