baseline-ui
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBaseline UI
基准UI规范
Enforces an opinionated UI baseline to prevent AI-generated interface slop.
强制执行一套带有明确倾向的UI基准规范,避免AI生成的界面出现混乱问题。
How to use
使用方法
-
Apply these constraints to any UI work in this conversation.
/baseline-ui -
Review the file against all constraints below and output:
/baseline-ui <file>- violations (quote the exact line/snippet)
- why it matters (1 short sentence)
- a concrete fix (code-level suggestion)
-
将这些约束应用于本次对话中的所有UI工作。
/baseline-ui -
根据以下所有约束审查文件并输出:
/baseline-ui <file>- 违规内容(引用确切的代码行/片段)
- 违规影响(一句话简要说明)
- 具体修复方案(代码层面的建议)
Stack
技术栈
- MUST use Tailwind CSS defaults unless custom values already exist or are explicitly requested
- MUST use (formerly
motion/react) when JavaScript animation is requiredframer-motion - SHOULD use for entrance and micro-animations in Tailwind CSS
tw-animate-css - MUST use utility (
cn+clsx) for class logictailwind-merge
- 除非已有自定义值或明确要求,否则必须使用Tailwind CSS默认值
- 当需要JavaScript动画时,必须使用(原
motion/react)framer-motion - 在Tailwind CSS中,入场动画和微动画应使用
tw-animate-css - 类逻辑必须使用工具(
cn+clsx)tailwind-merge
Components
组件
- MUST use accessible component primitives for anything with keyboard or focus behavior (,
Base UI,React Aria)Radix - MUST use the project’s existing component primitives first
- NEVER mix primitive systems within the same interaction surface
- SHOULD prefer for new primitives if compatible with the stack
Base UI - MUST add an to icon-only buttons
aria-label - NEVER rebuild keyboard or focus behavior by hand unless explicitly requested
- 对于任何涉及键盘或焦点交互的元素,必须使用可访问的组件基础库(、
Base UI、React Aria)Radix - 必须优先使用项目中已有的组件基础库
- 不得在同一交互界面中混合使用不同的组件基础库
- 如果与技术栈兼容,新增组件基础库应优先选择
Base UI - 纯图标按钮必须添加属性
aria-label - 除非明确要求,否则不得手动重写键盘或焦点交互逻辑
Interaction
交互
- MUST use an for destructive or irreversible actions
AlertDialog - SHOULD use structural skeletons for loading states
- NEVER use , use
h-screenh-dvh - MUST respect for fixed elements
safe-area-inset - MUST show errors next to where the action happens
- NEVER block paste in or
inputelementstextarea
- 对于破坏性或不可撤销的操作,必须使用组件
AlertDialog - 加载状态应使用结构化骨架屏
- 不得使用,应使用
h-screenh-dvh - 固定定位元素必须遵循安全区域规则
safe-area-inset - 错误提示必须显示在操作发生的位置附近
- 不得阻止或
input元素的粘贴功能textarea
Animation
动画
- NEVER add animation unless it is explicitly requested
- MUST animate only compositor props (,
transform)opacity - NEVER animate layout properties (,
width,height,top,left,margin)padding - SHOULD avoid animating paint properties (,
background) except for small, local UI (text, icons)color - SHOULD use on entrance
ease-out - NEVER exceed for interaction feedback
200ms - MUST pause looping animations when off-screen
- SHOULD respect
prefers-reduced-motion - NEVER introduce custom easing curves unless explicitly requested
- SHOULD avoid animating large images or full-screen surfaces
- 除非明确要求,否则不得添加动画
- 只能对合成器属性(、
transform)执行动画opacity - 不得对布局属性(、
width、height、top、left、margin)执行动画padding - 除小型局部UI(文本、图标)外,应避免对绘制属性(、
background)执行动画color - 入场动画应使用缓动函数
ease-out - 交互反馈动画时长不得超过
200ms - 循环动画在离开屏幕时必须暂停
- 应遵循用户偏好设置
prefers-reduced-motion - 除非明确要求,否则不得引入自定义缓动曲线
- 应避免对大型图片或全屏元素执行动画
Typography
排版
- MUST use for headings and
text-balancefor body/paragraphstext-pretty - MUST use for data
tabular-nums - SHOULD use or
truncatefor dense UIline-clamp - NEVER modify (
letter-spacing) unless explicitly requestedtracking-*
- 标题必须使用,正文/段落必须使用
text-balancetext-pretty - 数据内容必须使用
tabular-nums - 紧凑UI应使用或
truncateline-clamp - 除非明确要求,否则不得修改(
letter-spacing类)tracking-*
Layout
布局
- MUST use a fixed scale (no arbitrary
z-index)z-* - SHOULD use for square elements instead of
size-*+w-*h-*
- 必须使用固定的层级体系(不得使用任意
z-index值)z-* - 方形元素应使用类,而非
size-*+w-*组合h-*
Performance
性能
- NEVER animate large or
blur()surfacesbackdrop-filter - NEVER apply outside an active animation
will-change - NEVER use for anything that can be expressed as render logic
useEffect
- 不得对大型或
blur()元素执行动画backdrop-filter - 不得在非活跃动画场景下使用属性
will-change - 任何可通过渲染逻辑实现的功能,不得使用
useEffect
Design
设计
- NEVER use gradients unless explicitly requested
- NEVER use purple or multicolor gradients
- NEVER use glow effects as primary affordances
- SHOULD use Tailwind CSS default shadow scale unless explicitly requested
- MUST give empty states one clear next action
- SHOULD limit accent color usage to one per view
- SHOULD use existing theme or Tailwind CSS color tokens before introducing new ones
- 除非明确要求,否则不得使用渐变
- 不得使用紫色或多色渐变
- 不得将发光效果作为主要交互提示
- 除非明确要求,否则应使用Tailwind CSS默认阴影层级
- 空状态必须提供一个明确的下一步操作
- 每个视图的强调色使用应限制为一种
- 引入新颜色前,应优先使用现有主题或Tailwind CSS颜色令牌