coss
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecoss ui
coss ui
coss ui is a component library built on Base UI with a shadcn-like developer experience plus a large particle catalog.
coss ui 是基于Base UI构建的组件库,具备类shadcn的开发者体验,同时拥有丰富的粒子组件库。
What this skill is for
本技能的适用场景
Use this skill to:
- pick the right coss primitive(s) for a UI task
- write correct coss usage code (imports, composition, props)
- avoid common migration mistakes from shadcn/Radix assumptions
- reference particle examples to produce practical, production-like patterns
使用本技能可以:
- 为UI任务选择合适的coss基础组件
- 编写正确的coss使用代码(导入、组合、属性配置)
- 避免从shadcn/Radix迁移时的常见错误
- 参考粒子组件示例,生成实用的、贴近生产环境的实现模式
Source of truth
权威参考来源
- coss components docs:
apps/ui/content/docs/components/*.mdxhttps://github.com/cosscom/coss/tree/main/apps/ui/content/docs/components
- coss particle examples:
apps/ui/registry/default/particles/p-*.tsxhttps://github.com/cosscom/coss/tree/main/apps/ui/registry/default/particles
- coss particles catalog:
https://coss.com/ui/particles - docs map for agents:
https://coss.com/ui/llms.txt
- coss组件文档:
apps/ui/content/docs/components/*.mdx- 地址:
https://github.com/cosscom/coss/tree/main/apps/ui/content/docs/components
- 地址:
- coss粒子组件示例:
apps/ui/registry/default/particles/p-*.tsx- 地址:
https://github.com/cosscom/coss/tree/main/apps/ui/registry/default/particles
- 地址:
- coss粒子组件库:
https://coss.com/ui/particles - 面向Agent的文档映射:
https://coss.com/ui/llms.txt
Out of scope
不适用范围
- Maintaining coss monorepo internals/build pipelines.
- Editing registry internals unless explicitly requested.
- 维护coss单体仓库的内部逻辑/构建流水线。
- 编辑注册表内部内容(除非明确要求)。
Principles for agent output
Agent输出原则
- Use existing primitives and particles first before inventing custom markup.
- Prefer composition over custom behavior reimplementation.
- Follow coss naming and APIs from docs exactly.
- Keep examples accessible and production-realistic.
- Prefer concise code that mirrors coss docs/particles conventions.
- Assume Tailwind CSS v4 conventions in coss examples and setup guidance.
- 优先使用现有基础组件和粒子组件,而非自定义标记。
- 优先选择组件组合,而非重新实现自定义行为。
- 严格遵循文档中的coss命名规范和API。
- 示例需符合无障碍访问要求,且贴近生产实际。
- 优先使用简洁代码,与coss文档/粒子组件的规范保持一致。
- 在coss示例和设置指导中默认采用Tailwind CSS v4规范。
Critical usage rules
核心使用规则
Always apply before returning coss code:
- Do not invent coss APIs. Verify against component docs first.
- For trigger-based primitives (Dialog, Menu, Select, Popover, Tooltip), follow each primitive's documented trigger/content hierarchy and composition API; do not mix patterns across components.
- Preserve accessibility labels and error semantics.
- Consult primitive-specific guides for component invariants and edge cases.
- For manual install guidance, include all required dependencies and local component files referenced by imports.
- Prefer styled coss exports first; use exports only when custom composition/styling requires it.
*Primitive
Rule references (read on demand when the task touches these areas):
- — Tailwind tokens, icon conventions, data-slot selectors
./references/rules/styling.md - — Field composition, validation, input patterns
./references/rules/forms.md - — Trigger/popup hierarchies, grouped controls
./references/rules/composition.md - — shadcn/Radix to coss/Base UI migration patterns
./references/rules/migration.md
返回coss代码前必须遵守:
- 不得自定义coss API,需先对照组件文档进行验证。
- 对于基于触发器的基础组件(Dialog、Menu、Select、Popover、Tooltip),需遵循各组件文档中规定的触发器/内容层级和组合API;不得混用不同组件的实现模式。
- 保留无障碍访问标签和错误语义。
- 查阅基础组件的专属指南,了解组件的不变约束和边缘情况。
- 手动安装指导需包含所有必需的依赖项以及导入语句中引用的本地组件文件。
- 优先使用带样式的coss导出组件;仅在自定义组合/样式需求时使用导出。
*Primitive
规则参考(当任务涉及以下领域时按需查阅):
- —— Tailwind令牌、图标规范、data-slot选择器
./references/rules/styling.md - —— 字段组合、验证、输入模式
./references/rules/forms.md - —— 触发器/弹出层层级、分组控件
./references/rules/composition.md - —— 从shadcn/Radix到coss/Base UI的迁移模式
./references/rules/migration.md
Component discovery
组件查找
All 53 primitives have dedicated reference guides at . To find the right one for a task, consult the component registry index:
./references/primitives/<name>.md./references/component-registry.md
所有53个基础组件都有对应的参考指南,路径为。如需为任务选择合适的组件,请查阅组件注册表索引:
./references/primitives/<name>.md./references/component-registry.md
Usage workflow
使用流程
- Identify user intent (single primitive, composed flow, form flow, overlay flow, feedback flow).
- Consult to identify candidate primitives.
references/component-registry.md - Select primitives from coss docs first; avoid custom fallback unless needed.
- Check at least one particle example for practical composition patterns. Particle files live at (e.g.
apps/ui/registry/default/particles/p-<name>-<N>.tsx).p-dialog-1.tsx - Write minimal code using documented imports/props.
- Self-check accessibility and composition invariants.
- 明确用户意图(单个基础组件、组合流程、表单流程、浮层流程、反馈流程)。
- 查阅确定候选基础组件。
references/component-registry.md - 优先从coss文档中选择组件;除非必要,避免使用自定义替代方案。
- 至少参考一个粒子组件示例,了解实用的组合模式。粒子组件文件路径为(例如
apps/ui/registry/default/particles/p-<name>-<N>.tsx)。p-dialog-1.tsx - 使用文档中规定的导入方式和属性编写最简代码。
- 自行检查无障碍访问和组件组合的约束条件。
Installation reference
安装参考
See for full install/discovery workflow.
./references/cli.mdQuick CLI pattern:
bash
npx shadcn@latest add @coss/<component>Quick manual pattern:
- install dependencies listed in the component docs page
- copy required component file(s)
- update imports to match the target app alias setup
完整的安装/查找流程请查阅。
./references/cli.md快速CLI安装方式:
bash
npx shadcn@latest add @coss/<component>快速手动安装方式:
- 安装组件文档页面中列出的所有必需依赖项
- 复制所需的组件文件
- 更新导入语句以匹配目标应用的别名设置
Primitive Guidance
基础组件指导
Every primitive has a reference guide at with imports, minimal patterns, inline code examples, pitfalls, and particle references. Use the component registry to find the right file.
./references/primitives/<name>.mdHigh-risk primitives (read these guides first -- they have the most composition gotchas):
- — modal overlays, form-in-dialog, responsive dialog/drawer
./references/primitives/dialog.md - — dropdown actions, checkbox/radio items, submenus
./references/primitives/menu.md - — items-first pattern, multiple, object values, groups
./references/primitives/select.md - — Field composition, validation, submission
./references/primitives/form.md - — addons, DOM order invariant, textarea layouts
./references/primitives/input-group.md - — toastManager (not Sonner), anchored toasts, providers
./references/primitives/toast.md
每个基础组件都有对应的参考指南,路径为,内容包括导入方式、最简示例、内嵌代码示例、常见陷阱以及粒子组件参考。请通过组件注册表查找对应的文件。
./references/primitives/<name>.md高风险基础组件(建议先阅读这些指南——它们存在最多的组合陷阱):
- —— 模态浮层、对话框内嵌表单、响应式对话框/侧边栏
./references/primitives/dialog.md - —— 下拉操作、复选框/单选框选项、子菜单
./references/primitives/menu.md - —— 选项优先模式、多选、对象值、分组
./references/primitives/select.md - —— 字段组合、验证、提交
./references/primitives/form.md - —— 附加组件、DOM顺序约束、文本域布局
./references/primitives/input-group.md - —— toastManager(非Sonner)、锚定提示框、提供者
./references/primitives/toast.md
Output Checklist
输出检查清单
Before returning code:
- imports and props match coss docs
- composition structure is valid for selected primitive(s)
- accessibility and explicit control types (,
button, etc.) are presentinput - migration-sensitive flows are verified (type/lint, keyboard/a11y behavior, and SSR-sensitive primitives like Select/Command)
返回代码前需确认:
- 导入语句和属性与coss文档一致
- 组件组合结构对所选基础组件有效
- 包含无障碍访问支持和明确的控件类型(、
button等)input - 对迁移敏感的流程已验证(类型/语法检查、键盘/无障碍行为,以及对SSR敏感的基础组件如Select/Command)