userinterface-wiki by raphaelsalaja/userinterface-wiki
npx skills add https://github.com/raphaelsalaja/userinterface-wiki --skill userinterface-wiki全面的网页界面 UI/UX 最佳实践指南。包含 12 个类别共 152 条规则,按影响优先级排序,用于指导自动化代码审查和生成。
在以下情况下参考这些指南:
| 优先级 | 类别 | 影响 | 前缀 |
|---|---|---|---|
| 1 | 动画原则 | 关键 | timing-, physics-, staging- |
| 2 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 计时函数 |
| 高 |
spring-, easing-, duration-, none- |
| 3 | 退出动画 | 高 | exit-, presence-, mode-, nested- |
| 4 | CSS 伪元素 | 中 | pseudo-, transition-, native- |
| 5 | 音频反馈 | 中 | a11y-, appropriate-, impl-, weight- |
| 6 | 声音合成 | 中 | context-, envelope-, design-, param- |
| 7 | 变形图标 | 低 | morphing- |
| 8 | 容器动画 | 中 | container- |
| 9 | UX 定律 | 高 | ux- |
| 10 | 预测性预取 | 中 | prefetch- |
| 11 | 排版 | 中 | type- |
| 12 | 视觉设计 | 高 | visual- |
timing-under-300ms - 用户动画必须在 300 毫秒内完成timing-consistent - 相似元素使用相同的计时值timing-no-entrance-context-menu - 上下文菜单:无进入动画,仅退出easing-natural-decay - 使用指数曲线实现自然衰减,而非线性easing-no-linear-motion - 线性缓动仅用于进度指示器physics-active-state - 交互式元素需要 :active 缩放变换physics-subtle-deformation - 挤压/拉伸范围在 0.95-1.05 之间physics-spring-for-overshoot - 超调并回弹使用弹簧动画,而非缓动physics-no-excessive-stagger - 每个项目的交错延迟小于 50 毫秒staging-one-focal-point - 一次只突出一个动画staging-dim-background - 调暗模态框/对话框背景staging-z-index-hierarchy - 动画元素遵循 z-index 层级spring-for-gestures - 手势驱动的运动(拖拽、轻弹)必须使用弹簧动画spring-for-interruptible - 可中断的运动必须使用弹簧动画spring-preserves-velocity - 弹簧动画在释放时保留输入能量spring-params-balanced - 避免弹簧参数中的过度振荡easing-for-state-change - 系统状态变化使用缓动曲线easing-entrance-ease-out - 进入动画使用 ease-outeasing-exit-ease-in - 退出动画使用 ease-ineasing-transition-ease-in-out - 视图过渡使用 ease-in-outeasing-linear-only-progress - 线性仅用于表示进度/时间duration-press-hover - 按下/悬停:120-180 毫秒duration-small-state - 小状态变化:180-260 毫秒duration-max-300ms - 用户触发的动画最长 300 毫秒duration-shorten-before-curve - 通过缩短持续时间而非调整曲线来修复缓慢感none-high-frequency - 高频交互无动画none-keyboard-navigation - 键盘导航即时响应,无动画none-context-menu-entrance - 上下文菜单:无进入动画,仅退出exit-requires-wrapper - 条件性运动元素需要 AnimatePresence 包装器exit-prop-required - AnimatePresence 中的元素需要 exit 属性exit-key-required - 动态列表需要唯一键,而非索引exit-matches-initial - 退出动画镜像初始状态以实现对称presence-hook-in-child - 在子组件中使用 useIsPresent,而非父组件presence-safe-to-remove - 在异步清理后调用 safeToRemovepresence-disable-interactions - 在正在退出的元素上禁用交互mode-wait-doubles-duration - 模式 "wait" 会使持续时间加倍;需减半计时mode-sync-layout-conflict - 模式 "sync" 会导致布局冲突mode-pop-layout-for-lists - 对列表重新排序使用 popLayoutnested-propagate-required - 嵌套的 AnimatePresence 需要 propagate 属性nested-consistent-timing - 协调父子退出动画的持续时间pseudo-content-required - ::before/::after 需要 content 属性pseudo-over-dom-node - 使用伪元素而非额外 DOM 节点进行装饰pseudo-position-relative-parent - 父元素需要 position: relativepseudo-z-index-layering - 使用 Z-index 实现正确的伪元素层级pseudo-hit-target-expansion - 使用负内边距扩大点击目标区域pseudo-marker-styling - 使用 ::marker 自定义列表项目符号样式pseudo-first-line-styling - 使用 ::first-line 进行排版处理transition-name-required - 视图过渡需要 view-transition-nametransition-name-unique - 每个过渡名称在过渡期间必须是唯一的transition-name-cleanup - 完成后移除过渡名称transition-over-js-library - 优先使用视图过渡 API 而非 JS 库transition-style-pseudo-elements - 通过 ::view-transition-group 样式自定义动画native-backdrop-styling - 使用 ::backdrop 设置对话框背景native-placeholder-styling - 使用 ::placeholder 设置输入框样式native-selection-styling - 使用 ::selection 设置文本选择样式a11y-visual-equivalent - 每个声音都必须有视觉等效物a11y-toggle-setting - 提供禁用声音的开关a11y-reduced-motion-check - 对于声音,需遵循 prefers-reduced-motion 设置a11y-volume-control - 允许独立调节音量appropriate-no-high-frequency - 打字或键盘导航时无声音appropriate-confirmations-only - 支付、上传、提交时使用声音appropriate-errors-warnings - 对于不容忽视的错误使用声音appropriate-no-decorative - 悬停或装饰性时刻无声音appropriate-no-punishing - 用声音告知,而非用刺耳声音惩罚impl-preload-audio - 预加载音频文件以避免延迟impl-default-subtle - 默认音量应轻柔(0.3),而非响亮impl-reset-current-time - 在重播前重置 currentTimeweight-match-action - 声音权重与操作重要性匹配weight-duration-matches-action - 声音持续时间与操作持续时间匹配context-reuse-single - 复用单个 AudioContext,不要为每个声音创建context-resume-suspended - 在播放前恢复挂起的 AudioContextcontext-cleanup-nodes - 播放后断开音频节点连接envelope-exponential-decay - 使用指数曲线实现自然衰减envelope-no-zero-target - 指数曲线目标值为 0.001,而非 0envelope-set-initial-value - 在应用曲线前设置初始值design-noise-for-percussion - 使用滤波后的噪声生成点击/敲击声design-oscillator-for-tonal - 使用带音高扫描的振荡器生成音调声design-filter-for-character - 使用带通滤波器塑造打击乐声音param-click-duration - 点击声:5-15 毫秒持续时间param-filter-frequency-range - 点击声滤波器:3000-6000Hzparam-reasonable-gain - 增益低于 1.0 以防止削波param-q-value-range - 滤波器 Q 值:2-5 以保持聚焦且自然morphing-three-lines - 每个图标恰好使用 3 条 SVG 线条morphing-use-collapsed - 未使用的线条使用折叠常量morphing-consistent-viewbox - 所有图标共享相同的 viewBox(14x14)morphing-group-variants - 旋转变体共享组和基线morphing-spring-rotation - 分组图标旋转使用弹簧物理效果morphing-reduced-motion - 遵循 prefers-reduced-motion 设置morphing-jump-non-grouped - 非分组图标之间瞬间旋转跳转morphing-strokelinecap-round - 使用圆形描边线帽morphing-aria-hidden - 图标 SVG 设置为 aria-hiddencontainer-two-div-pattern - 外部动画 div,内部测量 div;切勿是同一元素container-guard-initial-zero - 初始渲染时边界 === 0 的防护,回退到 "auto"container-use-resize-observer - 使用 ResizeObserver 进行测量,而非 getBoundingClientRectcontainer-overflow-hidden - 在过渡期间为动画容器设置 overflow: hiddencontainer-no-excessive-use - 谨慎使用:按钮、手风琴、交互元素container-callback-ref - 为测量钩子使用回调引用(而非 useRef)container-transition-delay - 添加小延迟以获得自然的追赶感ux-fitts-target-size - 调整交互目标大小以便于点击(最小 32px)ux-fitts-hit-area - 使用不可见内边距或伪元素扩大点击区域ux-hicks-minimize-choices - 最小化选择以减少决策时间ux-millers-chunking - 将数据分块为 5-9 组以提高可扫描性ux-doherty-under-400ms - 在 400 毫秒内响应以感觉即时ux-doherty-perceived-speed - 使用骨架屏、乐观 UI、进度指示器模拟速度感ux-postels-accept-messy-input - 接受混乱的输入,输出干净的数据ux-progressive-disclosure - 显示当前重要的内容,稍后揭示复杂性ux-jakobs-familiar-patterns - 使用用户从其他网站熟悉的 UI 模式ux-aesthetic-usability - 视觉抛光提升感知可用性ux-proximity-grouping - 通过更紧密的间距在空间上分组相关元素ux-similarity-consistency - 相似元素应看起来相似ux-common-region-boundaries - 使用边界来分组相关内容ux-von-restorff-emphasis - 使重要元素在视觉上与众不同ux-serial-position - 将关键项目放在序列的开头或结尾ux-peak-end-finish-strong - 以清晰的成功状态结束体验ux-teslers-complexity - 将复杂性转移到系统,而非用户ux-goal-gradient-progress - 显示完成目标的进度ux-zeigarnik-show-incomplete - 显示未完成状态以驱动完成ux-pragnanz-simplify - 将复杂的视觉效果简化为清晰的形式ux-pareto-prioritize-features - 优先考虑关键的 20% 功能ux-cognitive-load-reduce - 尽量减少无关的认知负荷ux-uniform-connectedness - 使用线条或框架在视觉上连接相关元素prefetch-trajectory-over-hover - 基于悬停轨迹进行预测;可节省 100-200 毫秒prefetch-not-everything - 根据意图而非视口进行预取;避免浪费带宽prefetch-hit-slop - 使用 hitSlop 更早触发预测prefetch-touch-fallback - 在触摸设备上优雅降级(无光标)prefetch-keyboard-tab - 在键盘导航焦点接近时进行预取prefetch-use-selectively - 在延迟明显的地方使用预测性预取type-tabular-nums-for-data - 列、仪表板、定价使用等宽数字type-oldstyle-nums-for-prose - 旧式数字融入正文文本type-slashed-zero - 在代码相关的 UI 中使用带斜杠的零type-opentype-contextual-alternates - 保持 calt 启用以进行上下文字形调整type-disambiguation-stylistic-set - 启用 ss02 以区分 I/l/1 和 0/Otype-optical-sizing-auto - 保持 font-optical-sizing 为 auto 以实现尺寸自适应字形type-antialiased-on-retina - 在视网膜显示屏上使用抗锯齿字体平滑type-text-wrap-balance-headings - 标题使用 text-wrap: balance 以实现均匀行type-underline-offset - 将下划线偏移到降部下方type-no-font-synthesis - 禁用 font-synthesis 以防止伪造粗体/斜体type-font-display-swap - 使用 font-display: swap 避免加载期间文本不可见type-variable-weight-continuous - 使用可变字体的连续粗细值(100-900)type-text-wrap-pretty - 正文使用 text-wrap: pretty 以减少孤行type-justify-with-hyphens - 将 text-align: justify 与 hyphens: auto 配对使用type-letter-spacing-uppercase - 为大写和小型大写字母文本添加字母间距type-proper-fractions - 使用对角分数表示正确的印刷分数visual-concentric-radius - 内半径 = 外半径减去内边距,用于嵌套元素visual-layered-shadows - 叠加多个阴影以实现逼真的深度visual-shadow-direction - 所有阴影共享相同的偏移方向(单一光源)visual-no-pure-black-shadow - 阴影使用中性色,而非纯黑色visual-shadow-matches-elevation - 阴影大小按一致的比例表示高度visual-animate-shadow-pseudo - 通过伪元素不透明度动画化阴影以提高性能visual-consistent-spacing-scale - 使用一致的间距比例,而非任意值visual-border-alpha-colors - 半透明边框可适应任何背景visual-button-shadow-anatomy - 六层阴影结构打造精致的按钮阅读单个规则文件以获取详细解释和代码示例:
rules/timing-under-300ms.md
rules/spring-for-gestures.md
rules/ux-doherty-under-400ms.md
rules/type-tabular-nums-for-data.md
每个规则文件包含:
获取包含所有扩展规则的完整指南:AGENTS.md
每周安装量
1.6K
仓库
GitHub 星标数
624
首次出现
8 天前
安全审计
安装于
codex1.6K
cursor1.6K
opencode1.6K
github-copilot1.6K
gemini-cli1.6K
amp1.6K
Comprehensive UI/UX best practices guide for web interfaces. Contains 152 rules across 12 categories, prioritized by impact to guide automated code review and generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefixes |
|---|---|---|---|
| 1 | Animation Principles | CRITICAL | timing-, physics-, staging- |
| 2 | Timing Functions | HIGH | spring-, easing-, duration-, none- |
| 3 | Exit Animations | HIGH | exit-, presence-, mode-, nested- |
| 4 | CSS Pseudo Elements | MEDIUM | pseudo-, transition-, native- |
| 5 | Audio Feedback | MEDIUM | a11y-, appropriate-, impl-, weight- |
| 6 | Sound Synthesis | MEDIUM | context-, envelope-, design-, param- |
| 7 | Morphing Icons | LOW | morphing- |
| 8 | Container Animation | MEDIUM | container- |
| 9 | Laws of UX | HIGH | ux- |
| 10 | Predictive Prefetching | MEDIUM | prefetch- |
| 11 | Typography | MEDIUM | type- |
| 12 | Visual Design | HIGH | visual- |
timing-under-300ms - User animations must complete within 300mstiming-consistent - Similar elements use identical timing valuestiming-no-entrance-context-menu - Context menus: no entrance animation, exit onlyeasing-natural-decay - Use exponential ramps for natural decay, not lineareasing-no-linear-motion - Linear easing only for progress indicatorsphysics-active-state - Interactive elements need :active scale transformphysics-subtle-deformation - Squash/stretch in 0.95-1.05 rangephysics-spring-for-overshoot - Springs for overshoot-and-settle, not easingphysics-no-excessive-stagger - Stagger delays under 50ms per itemspring-for-gestures - Gesture-driven motion (drag, flick) must use springsspring-for-interruptible - Interruptible motion must use springsspring-preserves-velocity - Springs preserve input energy on releasespring-params-balanced - Avoid excessive oscillation in spring paramseasing-for-state-change - System state changes use easing curveseasing-entrance-ease-out - Entrances use ease-outeasing-exit-ease-in - Exits use ease-ineasing-transition-ease-in-out - View transitions use ease-in-outeasing-linear-only-progress - Linear only for progress/time representationexit-requires-wrapper - Conditional motion elements need AnimatePresence wrapperexit-prop-required - Elements in AnimatePresence need exit propexit-key-required - Dynamic lists need unique keys, not indexexit-matches-initial - Exit mirrors initial for symmetrypresence-hook-in-child - useIsPresent in child, not parentpresence-safe-to-remove - Call safeToRemove after async cleanuppresence-disable-interactions - Disable interactions on exiting elementsmode-wait-doubles-duration - Mode "wait" doubles duration; halve timingmode-sync-layout-conflict - Mode "sync" causes layout conflictspseudo-content-required - ::before/::after need content propertypseudo-over-dom-node - Pseudo-elements over extra DOM nodes for decorationpseudo-position-relative-parent - Parent needs position: relativepseudo-z-index-layering - Z-index for correct pseudo-element layeringpseudo-hit-target-expansion - Negative inset for larger hit targetspseudo-marker-styling - Use ::marker for custom list bullet stylespseudo-first-line-styling - Use ::first-line for typographic treatmentstransition-name-required - View transitions need view-transition-nametransition-name-unique - Each transition name unique during transitiona11y-visual-equivalent - Every sound must have a visual equivalenta11y-toggle-setting - Provide toggle to disable soundsa11y-reduced-motion-check - Respect prefers-reduced-motion for sounda11y-volume-control - Allow independent volume adjustmentappropriate-no-high-frequency - No sound on typing or keyboard navappropriate-confirmations-only - Sound for payments, uploads, submissionsappropriate-errors-warnings - Sound for errors that can't be overlookedappropriate-no-decorative - No sound on hover or decorative momentsappropriate-no-punishing - Inform, don't punish with harsh soundscontext-reuse-single - Reuse single AudioContext, don't create per soundcontext-resume-suspended - Resume suspended AudioContext before playingcontext-cleanup-nodes - Disconnect audio nodes after playbackenvelope-exponential-decay - Exponential ramps for natural decayenvelope-no-zero-target - Exponential ramps target 0.001, not 0envelope-set-initial-value - Set initial value before rampingdesign-noise-for-percussion - Filtered noise for clicks/tapsdesign-oscillator-for-tonal - Oscillators with pitch sweep for tonal soundsdesign-filter-for-character - Bandpass filter to shape percussive soundsmorphing-three-lines - Every icon uses exactly 3 SVG linesmorphing-use-collapsed - Unused lines use collapsed constantmorphing-consistent-viewbox - All icons share same viewBox (14x14)morphing-group-variants - Rotational variants share group and base linesmorphing-spring-rotation - Spring physics for grouped icon rotationmorphing-reduced-motion - Respect prefers-reduced-motionmorphing-jump-non-grouped - Instant rotation jump between non-grouped iconsmorphing-strokelinecap-round - Round stroke line capsmorphing-aria-hidden - Icon SVGs are aria-hiddencontainer-two-div-pattern - Outer animated div, inner measured div; never same elementcontainer-guard-initial-zero - Guard bounds === 0 on initial render, fall back to "auto"container-use-resize-observer - Use ResizeObserver for measurement, not getBoundingClientRectcontainer-overflow-hidden - Set overflow: hidden on animated container during transitionscontainer-no-excessive-use - Use sparingly: buttons, accordions, interactive elementscontainer-callback-ref - Use callback ref (not useRef) for measurement hookscontainer-transition-delay - Add small delay for natural catching-up feelux-fitts-target-size - Size interactive targets for easy clicking (min 32px)ux-fitts-hit-area - Expand hit areas with invisible padding or pseudo-elementsux-hicks-minimize-choices - Minimize choices to reduce decision timeux-millers-chunking - Chunk data into groups of 5-9 for scannabilityux-doherty-under-400ms - Respond within 400ms to feel instantux-doherty-perceived-speed - Fake speed with skeletons, optimistic UI, progress indicatorsux-postels-accept-messy-input - Accept messy input, output clean dataux-progressive-disclosure - Show what matters now, reveal complexity laterprefetch-trajectory-over-hover - Trajectory prediction over hover; reclaims 100-200msprefetch-not-everything - Prefetch by intent, not viewport; avoid wasted bandwidthprefetch-hit-slop - Use hitSlop to trigger predictions earlierprefetch-touch-fallback - Fall back gracefully on touch devices (no cursor)prefetch-keyboard-tab - Prefetch on keyboard navigation when focus approachesprefetch-use-selectively - Use predictive prefetching where latency is noticeabletype-tabular-nums-for-data - Tabular numbers for columns, dashboards, pricingtype-oldstyle-nums-for-prose - Oldstyle numbers blend into body texttype-slashed-zero - Slashed zero in code-adjacent UIstype-opentype-contextual-alternates - Keep calt enabled for contextual glyph adjustmenttype-disambiguation-stylistic-set - Enable ss02 to distinguish I/l/1 and 0/Otype-optical-sizing-auto - Leave font-optical-sizing auto for size-adaptive glyphstype-antialiased-on-retina - Antialiased font smoothing on retina displaystype-text-wrap-balance-headings - text-wrap: balance on headings for even linesvisual-concentric-radius - Inner radius = outer radius minus padding for nested elementsvisual-layered-shadows - Layer multiple shadows for realistic depthvisual-shadow-direction - All shadows share same offset direction (single light source)visual-no-pure-black-shadow - Use neutral colors, not pure black, for shadowsvisual-shadow-matches-elevation - Shadow size indicates elevation in consistent scalevisual-animate-shadow-pseudo - Animate shadow via pseudo-element opacity for performancevisual-consistent-spacing-scale - Use a consistent spacing scale, not arbitrary valuesvisual-border-alpha-colors - Semi-transparent borders adapt to any backgroundRead individual rule files for detailed explanations and code examples:
rules/timing-under-300ms.md
rules/spring-for-gestures.md
rules/ux-doherty-under-400ms.md
rules/type-tabular-nums-for-data.md
Each rule file contains:
For the complete guide with all rules expanded: AGENTS.md
Weekly Installs
1.6K
Repository
GitHub Stars
624
First Seen
8 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex1.6K
cursor1.6K
opencode1.6K
github-copilot1.6K
gemini-cli1.6K
amp1.6K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
AI代码审查工具 - 自动化安全漏洞检测与代码质量分析 | 支持多领域检查清单
1,200 周安装
AI智能体长期记忆系统 - 精英级架构,融合6种方法,永不丢失上下文
1,200 周安装
AI新闻播客制作技能:实时新闻转对话式播客脚本与音频生成
1,200 周安装
Word文档处理器:DOCX创建、编辑、分析与修订痕迹处理全指南 | 自动化办公解决方案
1,200 周安装
React Router 框架模式指南:全栈开发、文件路由、数据加载与渲染策略
1,200 周安装
Nano Banana AI 图像生成工具:使用 Gemini 3 Pro 生成与编辑高分辨率图像
1,200 周安装
staging-one-focal-point - One prominent animation at a timestaging-dim-background - Dim modal/dialog backgroundsstaging-z-index-hierarchy - Animated elements respect z-index layersduration-press-hover - Press/hover: 120-180msduration-small-state - Small state changes: 180-260msduration-max-300ms - User-initiated max 300msduration-shorten-before-curve - Fix slow feel with shorter duration, not curvenone-high-frequency - No animation for high-frequency interactionsnone-keyboard-navigation - Keyboard navigation instant, no animationnone-context-menu-entrance - Context menus: no entrance, exit onlymode-pop-layout-for-lists - Use popLayout for list reorderingnested-propagate-required - Nested AnimatePresence needs propagate propnested-consistent-timing - Coordinate parent-child exit durationstransition-name-cleanup - Remove transition name after completiontransition-over-js-library - Prefer View Transitions API over JS librariestransition-style-pseudo-elements - Style ::view-transition-group for custom animationsnative-backdrop-styling - Use ::backdrop for dialog backgroundsnative-placeholder-styling - Use ::placeholder for input stylingnative-selection-styling - Use ::selection for text selection stylingimpl-preload-audio - Preload audio files to avoid delayimpl-default-subtle - Default volume subtle (0.3), not loudimpl-reset-current-time - Reset currentTime before replayweight-match-action - Sound weight matches action importanceweight-duration-matches-action - Sound duration matches action durationparam-click-duration - Click sounds: 5-15ms durationparam-filter-frequency-range - Click filter: 3000-6000Hzparam-reasonable-gain - Gain under 1.0 to prevent clippingparam-q-value-range - Filter Q: 2-5 for focused but naturalux-jakobs-familiar-patternsux-aesthetic-usability - Visual polish increases perceived usabilityux-proximity-grouping - Group related elements spatially with tighter spacingux-similarity-consistency - Similar elements should look alikeux-common-region-boundaries - Use boundaries to group related contentux-von-restorff-emphasis - Make important elements visually distinctux-serial-position - Place key items first or last in sequencesux-peak-end-finish-strong - End experiences with clear success statesux-teslers-complexity - Move complexity to the system, not the userux-goal-gradient-progress - Show progress toward completionux-zeigarnik-show-incomplete - Show incomplete state to drive completionux-pragnanz-simplify - Simplify complex visuals into clear formsux-pareto-prioritize-features - Prioritize the critical 20% of featuresux-cognitive-load-reduce - Minimize extraneous cognitive loadux-uniform-connectedness - Visually connect related elements with lines or framestype-underline-offset - Offset underlines below descenderstype-no-font-synthesis - Disable font-synthesis to prevent faux bold/italictype-font-display-swap - Use font-display: swap to avoid invisible text during loadtype-variable-weight-continuous - Use continuous weight values (100-900) with variable fontstype-text-wrap-pretty - text-wrap: pretty for body text to reduce orphanstype-justify-with-hyphens - Pair text-align: justify with hyphens: autotype-letter-spacing-uppercase - Add letter-spacing to uppercase and small-caps texttype-proper-fractions - Use diagonal-fractions for proper typographic fractionsvisual-button-shadow-anatomy - Six-layer shadow anatomy for polished buttons