status
kibo-ui-registry/statusFreeComponent
Status components are used to display the uptime of a service.
Live preview
live · rendered by the registry
Rendered by Kibo UI Registry on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.kibo-ui.com/r/status.jsonSource
1import type { ComponentProps, HTMLAttributes } from "react";2import { Badge } from "@/components/ui/badge";3import { cn } from "@/lib/utils";45export type StatusProps = ComponentProps<typeof Badge> & {6 status: "online" | "offline" | "maintenance" | "degraded";7};89export const Status = ({ className, status, ...props }: StatusProps) => (10 <Badge11 className={cn("flex items-center gap-2", "group", status, className)}12 variant="secondary"13 {...props}14 />15);1617export type StatusIndicatorProps = HTMLAttributes<HTMLSpanElement>;1819export const StatusIndicator = ({20 className,21 ...props22}: StatusIndicatorProps) => (23 <span className="relative flex h-2 w-2" {...props}>24 <span25 className={cn(26 "absolute inline-flex h-full w-full animate-ping rounded-full opacity-75",27 "group-[.online]:bg-emerald-500",28 "group-[.offline]:bg-red-500",29 "group-[.maintenance]:bg-blue-500",30 "group-[.degraded]:bg-amber-500"31 )}32 />33 <span34 className={cn(35 "relative inline-flex h-2 w-2 rounded-full",36 "group-[.online]:bg-emerald-500",37 "group-[.offline]:bg-red-500",38 "group-[.maintenance]:bg-blue-500",39 "group-[.degraded]:bg-amber-500"40 )}41 />42 </span>43);4445export type StatusLabelProps = HTMLAttributes<HTMLSpanElement>;4647export const StatusLabel = ({48 className,49 children,50 ...props51}: StatusLabelProps) => (52 <span className={cn("text-muted-foreground", className)} {...props}>53 {children ?? (54 <>55 <span className="hidden group-[.online]:block">Online</span>56 <span className="hidden group-[.offline]:block">Offline</span>57 <span className="hidden group-[.maintenance]:block">Maintenance</span>58 <span className="hidden group-[.degraded]:block">Degraded</span>59 </>60 )}61 </span>62);
What it pulls in
Other registry items
Files it writes
More from Kibo UI Registry
All 41 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| announcementannouncement | Kibo UI Registry | Components | Free | no deps | |
| avatar-stackavatar-stack | Kibo UI Registry | Components | Free | no deps | |
| bannerbanner | Kibo UI Registry | Components | Free | 2 deps | |
| calendarcalendar | Kibo UI Registry | Components | Free | 3 deps | |
| choiceboxchoicebox | Kibo UI Registry | Components | Free | 2 deps | |
| code-blockcode-block | Kibo UI Registry | Components | Free | 5 deps · 2 files | |
| color-pickercolor-picker | Kibo UI Registry | Components | Free | 3 deps | |
| comboboxcombobox | Kibo UI Registry | Components | Free | 2 deps |
