Centering Filter Chips with Habit Cards
Selecting a category chip scrolls the row to center it over 205ms and cross-fades the old and new highlight colors, while a pinned All chip stays left as frosted glass. Habit cards show segmented count rings. Shared core for HTML and React Native.
export function Example() {
const progress = useSharedValue(0);
…
Agent prompt
Add the Now In Code component "centering-filter-chips-with-habit-cards" to this project. The full source is attached at the end of this prompt. Put the files under components/centering-filter-chips-with-habit-cards/, 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
- 24 Oct 2026
- License
- Unlimited commercial projects
- Original design
- @dimagroshev on 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 dark daily habit list. A header shows the date and the total count, and a row of category chips sits under it, each with a colored dot and a count of what is left. Tapping a chip swaps the list to that category and fills the chip with a tint of its color while the old chip fades back. The row scrolls so the chosen chip lands in the middle, clamped at both ends. Habit cards carry a segmented count ring, a dashed ring or a green check, with strike-through text when done. Glass buttons and a bottom bar blur the content behind them.
How it's built
A shared JavaScript core holds the layout, the data and the timings, and the React Native component renders it with react-native-svg for icons, rings and the soft color glow on each card, which is a radial gradient. The chip row is a native horizontal ScrollView that the animation drives with a scrollTo call every frame, so the motion follows the core curve and a manual drag still gets native bounce. Glass surfaces use expo-blur, and a MaskedView fades the bottom blur in progressively. Selection tint and scroll use separate eased timings.
Good for
- Habit, task or reminder lists filtered by category
- Any chip filter row that should keep the active chip centered
- Dark screens that use glass buttons and a blurred bottom bar
Dependencies
react-native-svgexpo-blur@react-native-masked-view/masked-viewreact-native