byronwade/ui
Application UI

UI · Application UI

Activity ring

Ring visualisation with two modes: a single-value score gauge (value) or an interactive segmented donut (segments) with hover/pin, tooltip, legend, and draw-in.

@byronwade/foundation@byronwade/status-dot@byronwade/utils

Feature showcase

Installation

Features

  • 5 examples

    Default, Tones, With Verdict, Score, Score Tones.

API

Props

PropTypeDefaultDescription
segmentsRingSegment[]-Segmented mode: { value, label, tone?, href? } per segment.
valuenumber-Score mode: a single value (0–max) rendered as one arc.
state"default" | "loading" | "empty" | "success" | "error""default"Object state shown inside the ring — loading renders a skeleton, error a destructive ring with “N/A”; empty/success/default render the data you pass. No companion text; shift-free across states.
maxnumber100Score mode denominator for value.
toneStatusTone-Score mode: override the threshold-derived tone (scoreTone).
labelstring-Score mode: caption under the number.
sizenumber168 / 160Diameter in px (segments / score).
thicknessnumber12 / 10Ring stroke width (segments / score).
gapnumber18Segments: visual gap between segments.
centerLabelstring"total"Segments: caption under the idle centre total.
formatValue(n: number) => string-Segments: format the centre + tooltip values.
onSegmentClick(segment, index) => void-Segments: make segments actionable (drill-down).
verdictbooleanfalseSegments: show a derived headline below the ring.
captionstring-Segments: optional description line below the ring.

Dependencies

PackageKindDescription
@byronwade/foundationregistryInstalled through the byronwade/ui registry.
@byronwade/status-dotregistryInstalled through the byronwade/ui registry.
@byronwade/utilsregistryInstalled through the byronwade/ui registry.

Source and related

FilePath
Componentregistry/ui/activity-ring.tsx
Default examplecontent/examples/activity-ring/default.tsx
Tones examplecontent/examples/activity-ring/tones.tsx
With Verdict examplecontent/examples/activity-ring/with-verdict.tsx
Score examplecontent/examples/activity-ring/score.tsx
Score Tones examplecontent/examples/activity-ring/score-tones.tsx