Xzero UI
Pro library

Goal trackerPro

A team goals card where objectives open into key results with owners, confidence and progress bars. A weekly check-in updates a value, confidence and note in place, fills the bar and recalculates the objective, and a quarter selector steps from last quarter's final scores to next quarter's planning.

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

Pass quarters (each with id, label, status of active, closed or planning, optional meta and footnote, and objectives with key results). For each key result, set start, target and current in the metric's own units. The card works out progress itself, so a target below the start value (latency, cost) works with no extra setup. Save check-ins in onCheckIn(checkIn, { signal }). The card updates once the promise resolves. If it throws, the form shows "Not saved" and a Retry button. Control the selector with quarterId and onQuarterChange, and set autoPlay={false} in production. Helpers (keyResultProgress, objectiveProgress, formatGoalValue) and sampleGoalQuarters are exported.

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/goal-tracker

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 { GoalTracker, type GoalCheckIn, type GoalQuarter } from "@/components/xzero/blocks/goal-tracker/goal-tracker";

export function TeamGoals({ quarters }: { quarters: GoalQuarter[] }) {
  return (
    <GoalTracker
      title="Platform goals"
      quarters={quarters}
      onCheckIn={async (checkIn: GoalCheckIn, { signal }) => {
        const response = await fetch("/api/check-ins", { method: "POST", body: JSON.stringify(checkIn), signal });
        if (!response.ok) throw new Error("Check-in failed");
      }}
    />
  );
}

API reference

GoalTracker

A team goals card. Objectives expand into key results with owners, confidence and progress bars; a key result opens a weekly check-in that updates its value, confidence and note, animates the bar and recalculates the objective. A quarter selector steps between closed, active and planning quarters. With no props it shows sample Q4 2026 goals and plays one check-in.

PropTypeDefaultDescription
quartersGoalQuarter[]sampleGoalQuartersQuarters, oldest first. Each has id, label, status (active, closed or planning), optional meta and footnote lines, and objectives. Seeds the card; saved check-ins update it in place.
titlestring"Company goals"Card heading.
quarterIdstring–Selected quarter id. Pair with onQuarterChange to control the selector.
defaultQuarterIdstringthe active quarterQuarter shown first when uncontrolled.
onQuarterChange(quarterId: string) => void–Called when the person steps to another quarter.
onCheckIn(checkIn: GoalCheckIn, context: { signal: AbortSignal }) => Promise<void> | void–Saves a check-in: quarterId, objectiveId, keyResultId, value, previousValue, confidence and note. Throw to show the error state with Retry; the signal aborts when the person cancels. Leave it out to simulate a save.
autoPlaybooleantrue with sample data, false with your ownPlays one scripted check-in the first time the card scrolls into view. Any pointer or key input hands control back at once.
classNamestring–Extra class on the card.

GoalKeyResult

One measurable result. Progress runs from start to target, so a target below start (latency, cost, ticket counts) also works.

PropTypeDefaultDescription
id (required)string–Stable id, returned in GoalCheckIn.
title (required)string–What success looks like, such as "Checkout p95 latency under 400 ms".
start (required)number–Value when the quarter began.
target (required)number–Value that counts as 100%.
current (required)number–Latest checked in value.
prefixstring–Text before the number, such as "$".
unitstring–Text after the number, such as "%", " ms" or "k".
decimalsnumber0Decimal places shown and pre-filled in the check-in.
confidence (required)"on-track" | "at-risk" | "off-track"–Owner's confidence, shown as an icon and label and as the bar color.
source{ name: string; icon?: ReactNode }–Where the number is synced from, shown as a small mark (Stripe, Linear, Vercel in the sample).

GoalObjective

An objective with its owner and key results. Progress is the mean of its key results; confidence is their rounded mean.

PropTypeDefaultDescription
id (required)string–Stable id.
title (required)string–The objective.
owner (required){ name: string; avatar?: string }–Owner shown with an avatar; initials when there is no image.
keyResults (required)GoalKeyResult[]–Two to five key results reads best.

Keyboard interactions

KeysAction
TabMoves through the quarter buttons, objectives, key results and the footer Check in button.
Enter / SpaceOn an objective, expands or collapses it. On a key result, opens its check-in with the value selected.
Arrow keysIn the check-in, moves between On track, At risk and Off track.
EnterIn the check-in, saves.
EscapeCancels the check-in and returns focus to the key result.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. 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