AnyBio
Components

bio-progress-ring

<bio-progress-ring>

A circular progress indicator showing episode adherence — how many days the user has completed out of their current program day. Supports both static configuration and profile-driven mode.

<bio-progress-ring size="180" stroke-width="12"></bio-progress-ring>

How It Works

When <bio-progress-ring> receives context from a parent <bio-provider>:

  1. Resolves progress data — in profile-driven mode, reads current_day, completed_days, total_days, adherence_pct, and streak from the SDK config's progress section
  2. Renders an SVG ring — the arc fill represents adherence percentage, animated on load
  3. Shows key metrics — day count, total days, adherence percentage, and current streak
  4. Handles zero state — when no days are completed, shows a friendly "Day N, just getting started!" message instead of "0 of N days"

Modes

Profile-Driven Mode

Omit all attributes and let the widget auto-configure from the episode profile:

<bio-progress-ring size="180" stroke-width="12"></bio-progress-ring>

Static Mode

Pass progress data directly as attributes:

<bio-progress-ring
  current-day="5"
  completed-days="4"
  total-days="30"
  streak="3"
  size="180"
  stroke-width="12">
</bio-progress-ring>

Attributes

AttributeTypeRequiredDescription
sizenumberNoDiameter of the ring in pixels. Defaults to 120.
stroke-widthnumberNoWidth of the ring stroke in pixels. Defaults to 10.
current-daynumberNoCurrent program day. Falls back to profile-driven value.
completed-daysnumberNoNumber of days completed. Falls back to profile-driven value.
total-daysnumberNoTotal program days. Falls back to profile-driven value.
streaknumberNoCurrent consecutive-day streak. Falls back to profile-driven value.
episode-idstringNoEpisode ID. Falls back to the episode resolved by <bio-provider>.

CSS Classes

ClassElement
.bio-progress-ringOuter container (flex column, centered)
.bio-progress-ring-labelDay count row
.bio-progress-ring-dayBold day number
.bio-progress-ring-total"/ 30 days" suffix
.bio-progress-ring-adherenceAdherence text or getting-started message
.bio-progress-ring-streakStreak badge (e.g., "3-day streak")

CSS Custom Properties

PropertyDefaultDescription
--bio-primary#5a8a6aRing fill color
--bio-border#e2e8f0Ring track (unfilled) color
--bio-surface-muted-fg#64748bSecondary text color
--bio-status-yellow#eab308Streak badge color

Code Examples

Profile-Driven

<bio-provider
  api-key="org_your_key"
  project-key="proj_your_key"
  xuser-id="user-123">

  <bio-progress-ring size="200" stroke-width="14"></bio-progress-ring>

</bio-provider>

Custom Styling

bio-progress-ring {
  --bio-primary: #1a73e8;
  --bio-status-yellow: #f59e0b;
}

.bio-progress-ring-day {
  font-size: 2rem;
}

On this page