BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/8starlabs-ui/status-monitor

Status Monitor

8starlabs-ui/status-monitor
FreeComponent

A compact status history bar for showing service uptime across days or hours.

Live preview

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

Install it

npx shadcn@latest add https://ui.8starlabs.com/r/status-monitor.json

Source

registry/8starlabs-ui/blocks/status-monitor.tsxui.8starlabs.com/r/status-monitor.json · first 6 KB
1"use client";
2
3import React, { useEffect, useMemo, useRef, useState } from "react";
4import {
5 AlertTriangleIcon,
6 CheckCircle2Icon,
7 CircleOffIcon,
8 XCircleIcon
9} from "lucide-react";
10
11import {
12 Tooltip,
13 TooltipContent,
14 TooltipProvider,
15 TooltipTrigger
16} from "@/registry/8starlabs-ui/ui/tooltip";
17import { cn } from "@/lib/utils";
18
19type AppStatus = "normal" | "warning" | "error" | "empty";
20
21export type AppStatusData = {
22 status: AppStatus;
23 timestamp?: string | Date;
24 info?: string;
25};
26
27export interface StatusMonitorProps
28 extends React.HTMLAttributes<HTMLDivElement> {
29 statuses: AppStatusData[];
30 unit?: "days" | "hours";
31 title?: string;
32 showUptime?: boolean;
33}
34
35interface AppStatusConfigData {
36 label: string;
37 defaultInfo: string;
38 barClassName: string;
39 textClassName: string;
40 Icon: React.ComponentType<React.SVGProps<SVGSVGElement>>;
41}
42
43const statusConfig = {
44 normal: {
45 label: "Normal",
46 defaultInfo: "Systems are operating normally.",
47 barClassName: "bg-green-600",
48 textClassName: "text-green-600",
49 Icon: CheckCircle2Icon
50 },
51 warning: {
52 label: "Warning",
53 defaultInfo:
54 "Systems are operating with elevated risk or degraded service.",
55 barClassName: "bg-amber-600",
56 textClassName: "text-amber-600",
57 Icon: AlertTriangleIcon
58 },
59 error: {
60 label: "Error",
61 defaultInfo: "A service-impacting incident is active.",
62 barClassName: "bg-red-600",
63 textClassName: "text-red-600",
64 Icon: XCircleIcon
65 },
66 empty: {
67 label: "No data",
68 defaultInfo: "No status data was recorded for this period.",
69 barClassName: "bg-muted",
70 textClassName: "text-muted-foreground",
71 Icon: CircleOffIcon
72 }
73} satisfies Record<AppStatus, AppStatusConfigData>;
74
75const BAR_WIDTH_PX = 5;
76const BAR_GAP_PX = 2;
77const MIN_VISIBLE_SLOTS = 30;
78const SLOT_COUNTS = [90, 60, MIN_VISIBLE_SLOTS] as const;
79
80function getTimelineWidth(numSlots: number) {
81 return numSlots * BAR_WIDTH_PX + (numSlots - 1) * BAR_GAP_PX;
82}
83
84function calculateNumDisplayableBars(width: number) {
85 return SLOT_COUNTS.find((slots) => width >= getTimelineWidth(slots)) ?? 30;
86}
87
88function formatTimestamp(timestamp: AppStatusData["timestamp"]) {
89 if (!timestamp) return undefined;
90
91 if (timestamp instanceof Date) {
92 return new Intl.DateTimeFormat("en-US", {
93 month: "short",
94 day: "2-digit",
95 year: "numeric"
96 }).format(timestamp);
97 }
98
99 return timestamp;
100}
101
102export default function StatusMonitor({
103 statuses,
104// … truncated

What it pulls in

npm packages

  • lucide-react

Other registry items

  • https://ui.8starlabs.com/r/tooltip.json

Files it writes

  • registry/8starlabs-ui/blocks/status-monitor.tsx

Facts

Registry
8starlabs-ui
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-04
Last confirmed
today

Go to the source

Docs on 8starlabs-ui ui.8starlabs.com Raw registry item This item as JSON

More from 8starlabs-ui

All 74 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Buttonbutton8starlabs-uiComponentsFree2 deps
Collapsiblecollapsible8starlabs-uiComponentsFree1 dep
Dropdown Menudropdown-menu8starlabs-uiComponentsFree2 deps
Flip clockflip-clock8starlabs-uiComponentsFreeno deps
Heatmapheatmap8starlabs-uiComponentsFreeno deps
Inputinput8starlabs-uiComponentsFreeno deps
JSON Viewerjson-viewer8starlabs-uiComponentsFree1 dep · 3 files
Labellabel8starlabs-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