AI 聊天打字与流式回复流程
首页吉祥物以共享元素放大进入 AI Agent 页,标题逐词虚化入场。逐字输入的消息以气泡飞入,打字点形变为回复,流式文字与产品图依次显影,整段 19.2 秒循环。
灵感来自 @kitesdesign 在 X 上发布的设计由 Now In Code 从零重建
import { AI } from "./components";
export function Example() {
const progress = useSharedValue(0);
…
export function Example() {
const progress = useSharedValue(0);
…
Agent 提示词
Add the Now In Code component "ai-chat-typing-and-streaming-flow" to this project. The full source is attached at the end of this prompt. Put the files under components/ai-chat-typing-and-streaming-flow/, 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月6日
- 许可证
- 无限商业项目
- 原始设计
- @kitesdesign(X)
你是设计者吗? 请求我们修改或下架此作品.
CLI 与 MCP 服务器 即将推出
在终端添加作品,或让智能体自行获取。在此之前,用“复制提示词”也能做到。 文档
功能说明
一个健康应用的三个循环播放的页面。首页显示绿色仪表弧线(带条纹尾部)、卡片、标签栏,以及一个 AI 按钮。按下按钮后,首页内容隐藏,机器人吉祥物在 Agent 页面中放大并占据其位置,在那里漂浮并眨眼。六个标题词从模糊中升起,输入面板从底部滑入,建议标签随之滑入。一条消息逐字符输入,发送后气泡飞入吉祥物身后的位置,吉祥物缩小成为助手头像。页眉从 AI Agent 切换为 AI Chat。随后出现正在输入的指示点波动,回复从模糊中逐词流出;第二轮对话加入一张展开的卡片,其中三张产品图依次变清晰。
实现方式
一个统一的时间线函数返回任意时刻每个元素的状态,网页预览与 React Native 组件共用这段代码。吉祥物用 react-native-svg 绘制为 SVG,并作为共享元素在页面之间移动,缩放时带有轻微过冲。输入动画由逐字符的时间表驱动,因此按键间隔并不均匀。React Native 没有文字模糊,因此文字模糊通过两层叠放的 Text 交叉淡化实现,图片模糊则使用 Image 的 blurRadius 属性。字体来自 Expo Google Fonts 包,图标路径来自一个开源图标集,requestAnimationFrame 循环提供时间。文中考虑过聊天库,但未使用。
适用场景
- 将吉祥物从首页引导进入聊天的 AI 助手 onboarding
- 逐词淡入的流式回复
- 以对话作为入口的健康、健身和教练类应用
依赖
react-native-svg@expo-google-fonts/figtreereact-native标签
AI 助手按钮卡片聊天情感陪伴飞入飞出渐变健康健身浅色加载动画吉祥物极简形变导航栏转场拟物3D社交错峰入场文字动画输入框