BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/obsidianui/alert

alert

obsidianui/alert
FreeComponent

obsidianui publishes no description for this item.

Live preview

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

Install it

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

Source

components/ui/alert.tsxobsidianui.dev/r/alert.json
1import * as React from "react"
2import { cva, type VariantProps } from "class-variance-authority"
3
4import { cn } from "@/lib/utils"
5
6const alertVariants = cva(
7 "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",
8 {
9 variants: {
10 variant: {
11 default: "bg-card text-card-foreground",
12 destructive:
13 "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
14 },
15 },
16 defaultVariants: {
17 variant: "default",
18 },
19 }
20)
21
22function Alert({
23 className,
24 variant,
25 ...props
26}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
27 return (
28 <div
29 data-slot="alert"
30 role="alert"
31 className={cn(alertVariants({ variant }), className)}
32 {...props}
33 />
34 )
35}
36
37function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
38 return (
39 <div
40 data-slot="alert-title"
41 className={cn(
42 "col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
43 className
44 )}
45 {...props}
46 />
47 )
48}
49
50function AlertDescription({
51 className,
52 ...props
53}: React.ComponentProps<"div">) {
54 return (
55 <div
56 data-slot="alert-description"
57 className={cn(
58 "text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
59 className
60 )}
61 {...props}
62 />
63 )
64}
65
66export { Alert, AlertTitle, AlertDescription }

Files it writes

  • public/r/alert.json

Facts

Registry
obsidianui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-01
Last confirmed
3 days ago

Go to the source

Docs on obsidianui obsidianui.dev Atharvsinh-codez/ObsidianUI on GitHub Raw registry item This item as JSON

More from obsidianui

All 111 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
ai-inputai-inputobsidianuiComponentsFree2 deps
animated-tab-baranimated-tab-barobsidianuiComponentsFreeno deps
apple-spotlightapple-spotlightobsidianuiComponentsFree2 deps
avataravatarobsidianuiComponentsFree1 dep
badgebadgeobsidianuiComponentsFree1 dep
breadcrumbbreadcrumbobsidianuiComponentsFree2 deps
buttonbuttonobsidianuiComponentsFree1 dep
button-groupbutton-groupobsidianuiComponentsFree1 dep
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