Skip to main content

Fitness: Stride Pro

Stride plans training around your goals. The live session counts down each block, can pause and skip, and shows heart rate against zones on a gauge.

See it live, on any device

Use the whole app​

import { FitnessApp } from '@patine-ui/pro';

<FitnessApp />;
PropTypeDefault
initialRoute'today' | 'setup' | 'train' | 'workout' | 'session' | 'progress' | 'classes' | 'profile''today'
demo'ready' | 'loading' | 'empty' | 'error''ready'
insets{ top, bottom }None
platform'ios' | 'android' | 'web'Platform.OS

Screens move the platform's way: on iOS a pushed screen slides in from the trailing edge, on Android they fade through, on the web and between tabs they fade in. Reduce motion turns it off.

Screens​

ScreenWhat it does
TodayScreenRadialChart rings, the planned workout, StatsRow for steps, heart and sleep, the week's streak
SetupScreenSteps as progress, goals on a multiple ToggleGroup, a Slider and SegmentedControl for rhythm
TrainScreenPrograms in a Carousel and workouts filtered with chips
WorkoutScreenThe plan on Pro's Timeline with numbered markers
SessionScreenA countdown per block, Progress for the whole session, a GaugeChart of heart-rate zones, pause and skip
FitnessProgressScreenA year HeatmapChart, this week against last, weight with a target band, a RadarChart profile
ClassesScreenPro's EventCalendar of studio classes with booking in a BottomSheet
FitnessProfileScreenBadges and a sortable leaderboard Table

Every screen is exported on its own, takes its data as props, and has sample data as defaults. sessionAt(exercises, elapsed) says which block a session is on and what is left; heartZone(bpm) the zone.

Built with​

The free components, from patine-ui:

Avatar · Badge · BottomSheet · Button · Card · Carousel · ChipGroup · DescriptionList · Heading, Text · List, ListItem · Progress · SegmentedControl · Slider · Steps · Table · ToggleGroup

And from Patine Pro:

Files​

fitness/
├── hooks/
│ └── useFitness.ts
├── ClassesScreen.tsx
├── fitness.constants.ts
├── fitness.utils.ts
├── FitnessApp.tsx
├── FitnessProfileScreen.tsx
├── FitnessProgressScreen.tsx
├── index.ts
├── SessionScreen.tsx
├── SetupScreen.tsx
├── TodayScreen.tsx
├── TrainScreen.tsx
└── WorkoutScreen.tsx

It also uses shared/, the theme, money formatting and screen transitions every Pro app shares.

A look at the code​

The workout clock and heart-rate zones, from fitness.utils.ts:

/** Seconds as a clock: 75 is "1:15", 3725 is "1:02:05". */
export const clock = (seconds: number) => {
const s = Math.max(0, Math.floor(seconds));
const h = Math.floor(s / 3600);
const m = Math.floor((s % 3600) / 60);
const pad = (n: number) => String(n).padStart(2, '0');
return h ? `${h}:${pad(m)}:${pad(s % 60)}` : `${m}:${pad(s % 60)}`;
};

/** The heart-rate zone for a beat, from a max heart rate: 1 easy to 5 all out. */
export const heartZone = (bpm: number, max = 190) => {
const r = bpm / max;
return r < 0.6 ? 1 : r < 0.7 ? 2 : r < 0.8 ? 3 : r < 0.9 ? 4 : 5;
};
Get the source with Pro