Docs 文档
Storybook Docs

如何记录组件

当你在开发过程中编写组件故事时,你还会创建基本文档以供以后重新访问。

¥When you write component stories during development, you also create basic documentation to revisit later.

Storybook 为你提供了扩展此基本文档的工具,其中包含突出展示你的组件和故事的散文和布局。这允许你创建 UI 库使用指南、设计系统站点等。

¥Storybook gives you tools to expand this essential documentation with prose and layout that feature your components and stories prominently. That allows you to create UI library usage guidelines, design system sites, and more.

Docs page

如果你在 第一次 的项目中包括 Storybook,我们会为你提供一个 文档页面(简称 "自动文档"),位于你的故事附近。它是一个自动生成的基线模板,列出了你现有的故事和相关元数据。

¥If you're including Storybook in your project for the first time, we provide you with a documentation page ("Autodocs" for short), positioned near your stories. It's a baseline template automatically generated, listing your existing stories and relevant metadata.

此外,你可以根据需要自定义此模板,或使用 MDX 为每个组件创建自由格式的页面。在这两种情况下,你都将使用 Doc Blocks 作为构建块来创建功能齐全的文档。

¥Additionally, you can customize this template if needed or create free-form pages for each component using MDX. In both cases, you’ll use Doc Blocks as the building blocks to create full-featured documentation.

Docs 在大多数情况下自动配置为开箱即用。在某些情况下,你可能需要或想要调整配置。阅读有关 此处 的更多信息。

¥Docs is autoconfigured to work out of the box in most use cases. In some cases, you may need or want to tweak the configuration. Read more about it here.