带弹簧取消钮的液态进度药丸
点下药丸,右端以 gooey 颈部挤出 × 圆钮,整体按弹簧展开并带约 18% 超调。文案逐字换成 Updating,浅蓝光晕从左缘长出并匀速推进表示进度;点 × 以弹簧收回。
灵感来自 @Ui_meesha 在 X 上发布的设计由 Now In Code 从零重建
import { Piece } from "./components";
export function Example() {
const progress = useSharedValue(0);
…
export function Example() {
const progress = useSharedValue(0);
…
Agent 提示词
Add the Now In Code component "gooey-progress-pill-with-spring-cancel" to this project. The full source is attached at the end of this prompt. Put the files under components/gooey-progress-pill-with-spring-cancel/, 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、Web
- 依赖
- Expo SDK 54+
- 权限
- Pro
- 更新于
- 2026年10月30日
- 许可证
- 无限商业项目
- 原始设计
- @Ui_meesha(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
一个浅色药丸形按钮,上面写着 Update。点按后,一个圆形取消按钮通过黏糊糊的颈部从右端挤出,药丸和取消按钮作为一个整体保持居中。文字逐个字母变为 Updating:旧字母向上模糊消失,新字母从下方升起。淡蓝色光晕从左边缘生长,其前沿以稳定速度推过药丸,图标和文字在光晕经过时变暗。点按取消按钮后,它以更硬的弹簧收回,文字切换回原样,光晕淡出。
实现方式
纯 JavaScript 核心暴露一个帧函数,接收事件日志、当前时间和进度值。弹簧按段解析求解,因此被打断的点按会保留速度。黏糊形状是药丸与圆形之间的二次平滑最小值,并转换为一条闭合的 SVG 路径,而不是模糊加阈值滤镜。组件用 react-native-svg 绘制,并运行 requestAnimationFrame 循环。字母是独立的文字元素,带有逐字母的时间控制和类似模糊的偏移图层。
适用场景
- 可以中途取消的软件更新或下载按钮
- 只在运行期间才出现取消控件的任何长时间操作
- 不使用 SVG 滤镜的黏糊合并形状按钮参考
依赖
react-native-svgreact-native标签
按钮标签胶囊工作协作数据填充光效辉光黏连融合渐变图标浅色极简形变按压反馈习惯效率进度条拟物3D弹簧系统界面文字动画