Health
The state of a service in a word and a light: Working, Slow, Down, Not checked yet. With detail, since when or why.
import { Health, HealthSkeleton } from '@sypnia/ui/react'
The services of a project
- Database
- Working
- API
- Slowanswers in 1.8 s, usually 0.2 s
- Downsince 14:02
- Webhooks
- Not checked yet
- Files
Code
import { Health, HealthSkeleton, KeyValue } from '@sypnia/ui/react';
// Each service in a word and a light. The last one is still loading.
export default function Services() {
return (
<KeyValue items={[
['Database', <Health state="up" />],
['API', <Health state="degraded" detail="answers in 1.8 s, usually 0.2 s" />],
['Email', <Health state="down" detail="since 14:02" />],
['Webhooks', <Health state="unknown" />],
['Files', <HealthSkeleton />],
]} />
);
} When to use it
Use it when
- Status pages and the overview of a project's services.
Do not use it when
- States of things that are not services: use Status or Badge.
For everyone
- The word carries the meaning; the light only repeats it.
Props
| Health | Type | Default |
|---|---|---|
staterequired | "up" | "degraded" | "down" | "unknown" | |
detail | ReactNode | |
label | ReactNode |