canvas-component-naming
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUse simple, generic names. Never prefix component names with the project or
site name. Components should be reusable and their names should describe their
purpose, not their origin.
Use for component names (for example, ,
, and story filenames).
kebab-casemachineNamesrc/components/<name>/When copying and modifying an example component, keep the original name unless
the component serves a fundamentally different purpose. When creating a new
component without an example, choose a simple, descriptive name.
undefined使用简单、通用的名称。切勿在组件名称前添加项目或站点名称前缀。组件应具备可复用性,其名称应描述用途而非来源。
组件名称采用格式(例如、以及故事文件名)。
kebab-casemachineNamesrc/components/<name>/复制并修改示例组件时,除非组件的用途发生根本性变化,否则保留原名称。创建无示例参考的新组件时,选择简单且具有描述性的名称。
undefinedCorrect - simple, descriptive names
Correct - simple, descriptive names
footer
hero
navigation
contact-form
footer
hero
navigation
contact-form
Wrong - prefixed with project/site name
Wrong - prefixed with project/site name
nebula-footer
acme-hero
mysite-navigation
projectx-contact-form
This ensures components remain portable and their names clearly communicate
their function rather than their project context.nebula-footer
acme-hero
mysite-navigation
projectx-contact-form
这样可确保组件保持可移植性,且名称能清晰传达其功能而非所属项目背景。