Habit Streak, Goal and Fasting Timer Screens
A 21.6-second loop cross-fades four scenes: a habit page with streak stats and a dot grid, a reading goal stepping to 83%, a fasting slider with rolling digits, and a lock screen whose card stack expands into live timers. Core React Native views only.
export function Example() {
const progress = useSharedValue(0);
…
Agent prompt
Add the Now In Code component "habit-streak-goal-fasting-screens" to this project. The full source is attached at the end of this prompt. Put the files under components/habit-streak-goal-fasting-screens/, install the listed dependencies with `npx expo install`, and render it on a route I can open. Keep the timing and easing values documented in the source comments. Replace the sample copy and artwork with content from my app, or leave placeholders and list what I still need to supply. === Source files are attached here for paid plans ===
Details
- Platforms
- iOS, Android
- Requires
- Expo SDK 54+
- Access
- Pro
- Updated
- 22 Sep 2026
- License
- Unlimited commercial projects
- Original design
- X
Are you the designer? Ask us to change or remove this.
Add pieces from the terminal or let your agent fetch them. Until then, Copy prompt does the same job. Docs
What it does
A scripted tour of a habit tracker on a tall phone screen, looping in about twenty-two seconds. A workout page shows a photo header, a dot grid of check-ins and a counter that ticks up, and it scrolls with a fling, a return and a small overshoot at the top. A reading-goal page lets the target change between three, four and five books, with the percentage and progress bar updating. A fasting page shows a large running timer and a range bar. Then it cross-fades to a lock screen with a big clock, a stacked live-activity card and an expanded view with habit check-ins, a fasting timer, a close button and a progress bar.
How it's built
One pure JavaScript function turns the elapsed time into every scroll offset, counter value, slider position, progress fraction and card expansion state, and the component re-renders from it on a requestAnimationFrame loop. The whole device frame, lock screen and cards are built from plain React Native views and Text, with only the header photos and wallpaper as bundled images. The only imports are React Native itself and one small SVG use. A frozen-time prop allows still frames, and numbers tick at measured times.
Good for
- A showcase reel for a habit, fitness or fasting app
- A lock-screen or live-activity style card with a collapsed and an expanded state
- A pattern for animating counters, bars and timers from one time function
Dependencies
react-native