跳到正文
UIGrammer
EN 中文

动画 · 悬停与焦点 · 03

按钮按压

按钮按压 = 按钮在点击瞬间缩小一毫,给出已触发的触感反馈。

直达修改 Prompt

尊重 prefers-reduced-motion:动画关闭,仅保留终态。

按钮按压是什么?

按压动画是你最划算的愉悦感。按钮被点中的瞬间缩小一毫,让点击像真实的物理按键。控制在 0.96、120ms 内——再长就像卡顿而不是反馈。

动画 标本

触发
click
技术
css
时长
1.6s
缓动
ease-in-out
性能
transform

什么时候用

  • Primary and secondary buttons of any kind
  • Icon buttons and toggle controls

什么时候别用

  • Tiny targets where 0.96 makes them hard to read
  • Loading buttons — the spinner already confirms the tap

Press feedback pairs with hover feedback; define both or the button feels dead between states.

另见

Add a press state to a button: scale(0.96) on :active, back to 1 on release, 100ms ease-out, transform only.