ActivityLine
单行文字,切换时交叉淡入淡出。
正在搜索网页
为什么不直接换文字
过渡期间,淡出和淡入的两行文字都在 DOM 中,叠放在同一个网格单元里。因此在整个淡入淡出过程中,整行的高度始终等于两者中较高的一行,宽度则按内容所需。
如果直接替换文字,活动行会因为字数变化而每隔几秒抖动一下。单行时不太明显,多行同时变化时就很显眼。
API
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
text* | string | — | Current line. Changing it slides the old line out and the new one in. |
className | string | — | — |
durationMs | number | 220 | Transition duration in milliseconds. |
style | CSSProperties | — | Merged over the duration custom property the transition reads. |
接下来
- ActivityBadge——一次工具调用长什么样
- 对话流——带脸的状态行