BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/scificn/alert

Alert

scificn/alert
FreeComponent

Alert panel with STATUS, WARNING, CRITICAL, and INFO variants.

Live preview

live · rendered by the registry
Rendered by scificn on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://www.scificn.dev/r/alert.json

Source

ui/alert/alert.tsxwww.scificn.dev/r/alert.json
1import * as React from 'react'
2import { cva, type VariantProps } from 'class-variance-authority'
3import { cn } from '@/lib/utils'
4
5const alertVariants = cva(
6 [
7 'relative w-full',
8 'border border-solid border-l-[3px]',
9 'p-4',
10 'font-mono',
11 'rounded-none',
12 ],
13 {
14 variants: {
15 variant: {
16 STATUS: [
17 'border-[var(--border)]',
18 'border-l-[var(--color-green)]',
19 'bg-[var(--surface)]',
20 ],
21 WARNING: [
22 'border-[var(--border)]',
23 'border-l-[var(--color-amber)]',
24 'bg-[var(--surface)]',
25 ],
26 CRITICAL: [
27 'border-[var(--border)]',
28 'border-l-[var(--color-red)]',
29 'bg-[var(--surface)]',
30 ],
31 INFO: [
32 'border-[var(--border)]',
33 'border-l-[var(--color-blue)]',
34 'bg-[var(--surface)]',
35 ],
36 },
37 },
38 defaultVariants: { variant: 'STATUS' },
39 }
40)
41
42const prefixMap = {
43 STATUS: { symbol: '◈', color: 'var(--color-green)', glow: 'var(--text-glow-green)' },
44 WARNING: { symbol: '⚠', color: 'var(--color-amber)', glow: 'var(--text-glow-amber)' },
45 CRITICAL: { symbol: '✕', color: 'var(--color-red)', glow: 'var(--text-glow-red)' },
46 INFO: { symbol: 'ℹ', color: 'var(--color-blue)', glow: 'var(--text-glow-blue)' },
47}
48
49export interface AlertProps
50 extends React.HTMLAttributes<HTMLDivElement>,
51 VariantProps<typeof alertVariants> {}
52
53const Alert = React.forwardRef<HTMLDivElement, AlertProps>(
54 ({ className, variant = 'STATUS', children, ...props }, ref) => {
55 const v = variant ?? 'STATUS'
56 const prefix = prefixMap[v]
57
58 return (
59 <div ref={ref} className={cn(alertVariants({ variant }), className)} role="alert" {...props}>
60 <div style={{ display: 'flex', gap: '0.5rem', alignItems: 'flex-start' }}>
61 <span
62 style={{
63 color: prefix.color,
64 textShadow: prefix.glow,
65 fontSize: '0.85rem',
66 lineHeight: 1.5,
67 flexShrink: 0,
68 }}
69 >
70 {prefix.symbol}
71 </span>
72 <div style={{ flex: 1 }}>{children}</div>
73 </div>
74 </div>
75 )
76 }
77)
78Alert.displayName = 'Alert'
79
80/* ── AlertTitle ── */
81const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
82 ({ className, style, ...props }, ref) => (
83 <h5
84 ref={ref}
85 className={cn(className)}
86 style={{
87// … truncated

What it pulls in

npm packages

  • class-variance-authority

Facts

Registry
scificn
Type
registry:ui
Access
Free
Files written
0
Licence
the repository states none
First indexed
2026-08-03
Last confirmed
today

Go to the source

Docs on scificn www.scificn.dev baxy5/scificn-ui on GitHub Raw registry item This item as JSON

More from scificn

All 33 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
BadgebadgescificnComponentsFree1 dep
Bar Chartbar-chartscificnComponentsFreeno deps
BreadcrumbbreadcrumbscificnComponentsFreeno deps
ButtonbuttonscificnComponentsFree2 deps
CardcardscificnComponentsFreeno deps
CheckboxcheckboxscificnComponentsFree1 dep
DialogdialogscificnComponentsFree1 dep
GridgridscificnComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex