居中滚动的筛选 chip 与习惯卡片
选中分类 chip 后,chip 行在 205ms 内把它滚到居中并交叉淡变新旧高亮色,左侧钉住的 All 是毛玻璃胶囊。习惯卡片带分段计数环。HTML 与 React Native 共用 core。
灵感来自 @dimagroshev 在 X 上发布的设计由 Now In Code 从零重建
import { Chip } from "./components";
export function Example() {
const progress = useSharedValue(0);
…
export function Example() {
const progress = useSharedValue(0);
…
Agent 提示词
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 ===
Pro 作品。提示词包含完整源码。开始使用
详情
- 平台
- iOS、Android
- 依赖
- Expo SDK 54+
- 权限
- Pro
- 更新于
- 2026年10月24日
- 许可证
- 无限商业项目
- 原始设计
- @dimagroshev(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
一个深色的每日习惯列表。页眉显示日期和总数,下面是一排分类胶囊,每个胶囊带有彩色圆点和剩余数量。点按胶囊会把列表切换到该分类,胶囊填充该颜色的浅色调,旧胶囊同时淡出。该行会滚动,使所选胶囊停在中间,两端会被限制。习惯卡片带有分段计数环、虚线环或绿色对勾,完成后文字带删除线。玻璃按钮和底部栏会模糊其后的内容。
实现方式
共享的 JavaScript 核心保存布局、数据和时间参数,React Native 组件用 react-native-svg 绘制图标、圆环,以及每张卡片上的柔和彩色光晕(为径向渐变)。胶囊行是原生水平 ScrollView,动画每一帧调用 scrollTo 驱动它,因此运动跟随核心的曲线,手动拖动仍保留原生回弹。玻璃表面使用 expo-blur,MaskedView 使底部模糊逐渐增强。选中时的色调和滚动使用各自独立的缓动时间。
适用场景
- 按分类过滤的习惯、任务或提醒列表
- 任何需要让当前选中胶囊保持居中的胶囊筛选行
- 使用玻璃按钮和模糊底部栏的深色界面
依赖
react-native-svgexpo-blur@react-native-masked-view/masked-viewreact-native标签
按钮卡片交叉淡化深色拖拽展开收起渐变健康健身图标液态玻璃列表极简导航栏习惯效率个人主页进度条滚动驱动弹簧状态切换标签栏