- Components
Score ring
A score from 0 to 100 with a text equivalent. Unassessed is distinct from zero.
npx shadcn add @klarhimmel/score-ringWhen to use
Use for
Bounded audit and quality scores with a readable text equivalent.
Not for
Loading or completion progress. Use Progress.
Pairs with
Audit overview and module cards.
Preview
score-ring.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { ScoreRing } from '@/components/klarhimmel/ui/score-ring';
export default function Example() {
return (
<Theme theme="brand">
<ScoreRing value={68} label="Readiness" />
</Theme>
);
}Install
Import
import { ScoreRing } from '@/components/klarhimmel/ui/score-ring';- Lands in
- components/klarhimmel/ui/score-ring.tsx, plus cn() and the theme item if they are missing. Import theme.css after Tailwind.
- Render in
- Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | null | required | 0–100; null or a non-finite value is unassessed. Values are clamped. |
label | ReactNode | required | Names the score in its visible caption. |
unavailable | ReactNode | Not assessed | Caption for an unassessed score. |
Accessibility
| Key | Does |
|---|---|
Screen reader | Reads the label and score caption; the ring is decorative. |