Agent Skills
› nexu-io/motion-anything
› ripple-press
ripple-press
GitHub提供从点击点绽放的涟漪反馈动画,轻量快速且符合无障碍规范。适用于按钮和可点击瓦片,避免用于破坏性操作或文本链接。支持自动清理、响应减少运动偏好及 React 集成。
Trigger Scenarios
用户询问如何实现 Material Design 风格的点击反馈效果
需要为按钮或可点击元素添加触觉视觉反馈但不希望使用重型库
讨论 UI 交互中的无障碍访问(如 prefers-reduced-motion)与性能优化
Install
npx skills add nexu-io/motion-anything --skill ripple-press -g -y
SKILL.md
Frontmatter
{
"od": {
"mode": "prototype",
"preview": {
"type": "html"
},
"surface": "web",
"category": "animation-motion",
"platform": "desktop",
"upstream": "https:\/\/m3.material.io\/foundations\/interaction\/states\/state-layers",
"design_system": {
"requires": false
},
"example_prompt": "Use ripple on the primary buttons: a fast, low-opacity ripple from the press point. Skip it on\ndestructive actions; none under reduced-motion."
},
"name": "ripple-press",
"triggers": [
"ripple",
"material ripple",
"tap feedback",
"press feedback",
"点按涟漪",
"水波反馈"
],
"description": "Acknowledge a tap\/click with a ripple that blooms from the exact press point. Fast and low-opacity\nso it reads as feedback, not decoration. No ripple under prefers-reduced-motion (native :active\ncovers it). Avoid on destructive actions and text links.\n"
}
ripple-press
A ripple that blooms from the press point. Part of
motion-anything; obeys MOTION-SPEC.md. Based on the
Material state-layer interaction, reimplemented dependency-free.
When to use it
- Buttons / clickable tiles where a tap should feel acknowledged; touch-first, app-like UIs.
When NOT to use it (restraint)
- Destructive actions (don't encourage repeat taps) and text links (feels heavy).
- Elements that already have a strong press state.
How to apply
- Copy
ripple.cssandripple.jsinto the project, and link them. - Mark the button (it should be
position:relative; overflow:hidden— the CSS sets this):<button class="ripple">Save</button> - Auto-attaches to
.ripple; a wave spawns at the pointer point and cleans itself up.
Accessibility & performance
- No ripple under
prefers-reduced-motion; the native:activestate provides feedback. - Transform/opacity only; each wave removes itself on
animationend.
Framework notes
- React: call
attachRipple(ref.current)inuseEffect. The tint comes from the element'scurrentColor— set text color to control it.
Version History
- b016900 Current 2026-07-11 17:10


