Status Indicator Glass
shadcn-glass-ui/status-indicator-glassFreeComponent
Status Indicator Glass component with glass effects
Install it
npx shadcn@latest add https://raw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/status-indicator-glass.jsonSource
1// ========================================2// STATUS INDICATOR GLASS COMPONENT3// Status dots with glow effect4// ========================================56import { forwardRef, type CSSProperties } from "react";7import { cn } from "@/lib/utils";8import "@/glass-theme.css";910export type StatusType = "green" | "yellow" | "red";11export type StatusSize = "normal" | "large";1213export interface StatusIndicatorGlassProps extends React.HTMLAttributes<HTMLDivElement> {14 readonly type?: StatusType;15 readonly size?: StatusSize;16}1718const sizeClasses: Record<StatusSize, string> = {19 normal: "w-2 h-2 md:w-2.5 md:h-2.5",20 large: "w-3.5 h-3.5 md:w-4 md:h-4",21};2223const statusSymbols: Record<StatusType, string> = {24 green: "✓",25 yellow: "!",26 red: "✕",27};2829// CSS variable maps for status colors (using semantic naming)30const statusVarMap: Record<StatusType, { bg: string; glow: string }> = {31 green: { bg: "var(--status-online)", glow: "var(--status-online-glow)" },32 yellow: { bg: "var(--status-away)", glow: "var(--status-away-glow)" },33 red: { bg: "var(--status-busy)", glow: "var(--status-busy-glow)" },34};3536export const StatusIndicatorGlass = forwardRef<HTMLDivElement, StatusIndicatorGlassProps>(37 ({ type = "green", size = "normal", className, ...props }, ref) => {38 const colors = statusVarMap[type];3940 const indicatorStyles: CSSProperties = {41 backgroundColor: colors.bg,42 boxShadow: colors.glow,43 };4445 return (46 <div47 ref={ref}48 className={cn(49 "rounded-full flex items-center justify-center",50 sizeClasses[size],51 className52 )}53 style={indicatorStyles}54 role="status"55 aria-label={`Status: ${type}`}56 {...props}57 >58 {size === "large" && (59 <span className="text-white text-[8px] md:text-[10px] font-bold">60 {statusSymbols[type]}61 </span>62 )}63 </div>64 );65 }66);6768StatusIndicatorGlass.displayName = "StatusIndicatorGlass";
More from shadcn-glass-ui
All 76 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alert Glassalert-glass | shadcn-glass-ui | Components | Free | no deps | |
| Animated Background Glassanimated-background-glass | shadcn-glass-ui | Components | Free | no deps | |
| Avatar Glassavatar-glass | shadcn-glass-ui | Components | Free | no deps | |
| Badge Glassbadge-glass | shadcn-glass-ui | Components | Free | no deps | |
| Base Progress Glassbase-progress-glass | shadcn-glass-ui | Components | Free | no deps | |
| Button Glassbutton-glass | shadcn-glass-ui | Components | Free | no deps | |
| Card Glasscard-glass | shadcn-glass-ui | Components | Free | no deps | |
| Checkbox Glasscheckbox-glass | shadcn-glass-ui | Components | Free | no deps |
