← 返回列表
全部 Skill›开发 Development›n8n-ui-design

n8n-ui-design

作者 @n8n-io · 语言 en
Guidelines on designing and building UI. Use when working in editor-ui or design-system packages. Triggers for tasks that include refactoring components, styling changes, or feature work.
开发 Development前端开发通用待翻译
存储库
最近源活动
—
检测 SKILL.md 语言
en
星标 ★
210,427
分支 Fork
0
安装选项
提示
指令
使用 AI 助手安装
将下面的提示复制到你正在使用的 AI 助手中。
下载完整 Skill 目录(含全部配套文件)。 下载压缩包 ↓
SKILL.md 原文预览

UI Design

Comprehensive guide for building, styling, and using components in the frontend.

References

  • When styling components, use packages/frontend/@n8n/design-system/src/styleguide/*.mdx
  • For animations, use rules/web-animation-guidelines.md
  • When reviewing UI changes, use rules/web-interface-guidelines.md

Best practices

  • ALWAYS use CSS variables from _tokens.scss or _primitives.scss in

packages/frontend/@n8n/design-system/src/css/. Look up every length, color,

font-size and duration before you write it as a literal. Each spacing token

carries its px value in a comment: --spacing--5xs: 0.125rem; / 2px /.

Grep that comment to find the token for a px value. The grep gives one hit for

each token family, so pick the family that matches the property: --spacing--*

for margin and padding, --radius--* for border-radius, --height--* for

height. The styleguide

packages/frontend/@n8n/design-system/src/styleguide/spacing-size.mdx lists the

same scale as a table. The spacing scale starts at 2px, so a small value is not

a reason to hardcode. Hardcode only if the lookup finds no token. Give the

reason in a comment.

  • ALWAYS prefer using existing components from packages/frontend/@n8n/design-system/src/components. Prefer components that aren't marked @deprecated.
  • If you need to add hover/active alpha behavior to solid components, prefer color-mix() with explicit percentages.
  • When working with animations or transitions, ALWAYS prefer using mixins from packages/frontend/@n8n/design-system/src/css/mixins/motion.scss

Components

Use existing design-system components over creating custom implementations:

  • "Add an enable or disable switch on a settings page" → Use N8nSettingsEnableRow. Place it in an N8nSettingsRowGroup, alone or with other rows. It does not have to sit at the top of the page. title and description are required. Bind :enabled and @update:enabled. The parent owns the value. The control is always a small switch, the same size as the other switches on settings screens. Set showPreviewBadge or showEnterpriseReadinessBadge to show those badges beside the title. Use N8nSettingsRow when the action is not a switch.
  • "Add a modal dialog for confirming workflow deletion" → Use N8nDialog
  • "Add a dropdown to select workflow status" → Use N8nDropdown or N8nSelect
  • "Add button with + icon to add new tiem" → Wrap N8nButton with iconOnly prop with N8nTooltip and wrap in N8nTooltip. Use N8nIcon and proper aria-label.
  • "Add a destructive action button" → use N8nButton with variant="destructive"
  • "Make background color white/black" → Use var(--background--surface) for white on light mode and "black" on dark mode
  • "Animate the title in gracefully" -> Use fade-in-up mixin from motion.scss with var(--duration--base)
评论
Nn8n-io
n8n-io
n8n-io/n8n
查看 GitHub 仓库 查看作者的其他 Skill
来源信息
作者@n8n-io
所属大类开发 Development / 前端开发
国内可用性通用
最近源活动—
风险提示无
提示:风险标签为程序静态扫描结果,仅作提示,不代表安全认证。安装前请阅读 SKILL.md 及其引用的脚本、权限,自行判断是否可信。