VisorVisor
ComponentsData Display

Reach Rings

Concentric rings, the innermost a filled core holding an icon, lit from the centre out to show how far something reaches.

Default

Pass levels (the core included) and value, how far the reach goes. value + 1 rings are lit, from the core outward: 0 lights the core alone and levels - 1 lights every ring. The icon in the core is yours to pass. Pair the rings with the control that sets the reach, here a stepped Radio Group: the chosen level's index is the value.

Rings light in sequence, 70ms apart from the centre outward, over a 500ms ease-out. With prefers-reduced-motion: reduce they change at once.

Compact

size="compact" draws the rings 112px across with 15px steps, for a narrow sheet. The default is 148px with 20px steps.

Theming

TokenBindsDefault
--reach-rings-keyA lit ring's stroke, halo and 5% wash, and the solid core--interactive-primary-bg
--reach-rings-ringAn unlit ring's stroke--text-primary at 12%
--reach-rings-core-inkThe icon on the lit core--interactive-primary-text
--reach-rings-glyphThe icon while the core is unlit--text-primary at 50%

A theme binds them from its yaml under components.reach-rings (key, ring, core-ink, glyph). See Component Tokens.

Installation

npx visor add reach-rings

This copies two files into your project:

  • components/ui/reach-rings/reach-rings.tsx — the component
  • components/ui/reach-rings/reach-rings.module.css — the styles

API Reference

ReachRingsProps

PropTypeDefaultDescription
levels*number—How many rings, the filled core included.
value*number—How far the reach goes: 0 (the core alone) to levels - 1 (every ring). value + 1 rings are lit, from the centre out; -1 lights none.
iconReactNode—The glyph in the core, passed in by the consumer.
size'default' | 'compact''default'default is 148px across; compact is 112px.

The component also accepts all standard <div> HTML attributes, on the root.

Accessibility

  • The rings are decorative: the root is aria-hidden="true" and announces nothing.
  • The control beside them carries the state and the names, so pair the rings with one (a stepped Radio Group, say) and never show them alone as the only sign of a setting.