BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-glass-ui/flag-alert-glass

Flag Alert Glass

shadcn-glass-ui/flag-alert-glass
FreeComponent

Flag Alert Glass component with glass effects

Install it

npx shadcn@latest add https://raw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/flag-alert-glass.json

Source

components/glass/specialized/flag-alert-glass.tsxraw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/flag-alert-glass.json
1// ========================================
2// FLAG ALERT GLASS COMPONENT
3// Individual warning/danger flag alert
4// ========================================
5
6import { forwardRef, useState, type CSSProperties } from 'react';
7import { cn } from '@/lib/utils';
8import { StatusIndicatorGlass, type StatusType } from './status-indicator-glass';
9import '@/glass-theme.css';
10
11export type FlagType = 'warning' | 'danger';
12
13export interface FlagAlertGlassProps extends React.HTMLAttributes<HTMLDivElement> {
14 readonly type?: FlagType;
15 readonly title: string;
16 readonly description?: string;
17}
18
19// CSS variable maps for flag types
20const flagVarMap: Record<
21 FlagType,
22 { bg: string; border: string; text: string; statusType: StatusType }
23> = {
24 danger: {
25 bg: 'var(--alert-danger-bg)',
26 border: 'var(--alert-danger-border)',
27 text: 'var(--alert-danger-text)',
28 statusType: 'red',
29 },
30 warning: {
31 bg: 'var(--alert-warning-bg)',
32 border: 'var(--alert-warning-border)',
33 text: 'var(--alert-warning-text)',
34 statusType: 'yellow',
35 },
36};
37
38export const FlagAlertGlass = forwardRef<HTMLDivElement, FlagAlertGlassProps>(
39 ({ type = 'warning', title, description, className, ...props }, ref) => {
40 const [isHovered, setIsHovered] = useState(false);
41 const config = flagVarMap[type];
42
43 const alertStyles: CSSProperties = {
44 background: config.bg,
45 borderColor: config.border,
46 transform: isHovered ? 'translateX(4px)' : 'translateX(0)',
47 };
48
49 return (
50 <div
51 ref={ref}
52 className={cn(
53 'p-2.5 md:p-3 rounded-xl border transition-all duration-300 max-w-md',
54 className
55 )}
56 style={alertStyles}
57 onMouseEnter={() => setIsHovered(true)}
58 onMouseLeave={() => setIsHovered(false)}
59 role="alert"
60 {...props}
61 >
62 <div
63 className="flex items-center gap-1.5 md:gap-2 font-medium text-xs md:text-sm"
64 style={{ color: config.text }}
65 >
66 <StatusIndicatorGlass type={config.statusType} />
67 {title}
68 </div>
69 {description && (
70 <p className="text-(length:--font-size-2xs) md:text-xs mt-0.5 md:mt-1 ml-4 md:ml-5 text-(--text-muted)">
71 {description}
72 </p>
73 )}
74 </div>
75 );
76 }
77);
78
79FlagAlertGlass.displayName = 'FlagAlertGlass';

Facts

Registry
shadcn-glass-ui
Type
registry:component
Access
Free
Files written
0
Licence
Apache-2.0
First indexed
2026-08-02
Last confirmed
today

Go to the source

yhooi2.github.io artyhoo/shadcn-glass-ui-library on GitHub Raw registry item This item as JSON

More from shadcn-glass-ui

All 76 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Alert Glassalert-glassshadcn-glass-uiComponentsFreeno deps
Animated Background Glassanimated-background-glassshadcn-glass-uiComponentsFreeno deps
Avatar Glassavatar-glassshadcn-glass-uiComponentsFreeno deps
Badge Glassbadge-glassshadcn-glass-uiComponentsFreeno deps
Base Progress Glassbase-progress-glassshadcn-glass-uiComponentsFreeno deps
Button Glassbutton-glassshadcn-glass-uiComponentsFreeno deps
Card Glasscard-glassshadcn-glass-uiComponentsFreeno deps
Checkbox Glasscheckbox-glassshadcn-glass-uiComponentsFreeno 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