Xzero UI
Pro library

Activity ringsPro

Daily goals as tick rings that sweep, count up, and trace a second lap past 100%.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/activity-rings
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/activity-rings

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { ActivityRings } from "@/components/xzero/activity-rings/activity-rings";

export function Today() {
  return (
    <ActivityRings
      metrics={[
        { id: "move", label: "Move", unit: "kcal", goal: 500 },
        { id: "exercise", label: "Exercise", unit: "min", goal: 30 },
        { id: "stand", label: "Stand", unit: "hr", goal: 12 },
      ]}
      days={week}
      onRingClose={(metric, day) => celebrate(metric, day)}
    />
  );
}

API reference

ActivityRings

Daily goals drawn as concentric tick rings. Arcs sweep to each day's value, a second lap traces the inside edge past 100%, and numbers count to their new amounts.

PropTypeDefaultDescription
metrics (required){ id: string; label: string; unit: string; goal: number; color?: string }[]–One ring per metric, from the outside in. color falls back to the built in indigo, amber, and sage.
days (required){ id: string; label: string; short: string; values: Record<string, number> }[]–Days with values keyed by metric id. label is the full date for assistive technology; short is shown under the day.
daystring–Controlled selected day id.
defaultDaystring–Initial day when uncontrolled. Defaults to the last day.
onDayChange(day: string) => void–Called when a day is picked.
focusedstring | null–Controlled isolated metric id.
defaultFocusedstring | nullnullInitial isolated metric when uncontrolled.
onFocusedChange(metric: string | null) => void–Called when a goal is selected or cleared from the legend.
onRingClose(metric: string, day: string) => void–Called when a value on the same day crosses its goal.
labelstring"Activity"Accessible name of the section.
classNamestring–Extra class on the root.

Keyboard interactions

KeysAction
Arrow keysIn the week picker, pick the previous or next day.
Home / EndIn the week picker, pick the first or last day.
Enter / SpaceOn a legend row, isolates that goal or clears it.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in data

Guidance for AI tools

Activity rings: Daily goals as tick rings that sweep, count up, and trace a second lap past 100%. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components