Docs
Storybook Docs

主要

Watch a video tutorial

Primary 块在 Story 块中显示主要(在故事文件中首先定义)故事。它通常在文档条目的标题下立即渲染。

¥The Primary block displays the primary (first defined in the stories file) story, in a Story block. It is typically rendered immediately under the title in a docs entry.

Screenshot of Primary block

{/* ButtonDocs.mdx */}
 
import { Meta, Primary } from '@storybook/blocks';
import * as ButtonStories from './Button.stories';
 
<Meta of={ButtonStories} />
 
<Primary />

主要

¥Primary

import { Primary } from '@storybook/blocks';

Primary 配置了以下属性:

¥Primary is configured with the following props:

of

类型:CSF 文件导出

¥Type: CSF file exports

指定哪个 CSF 文件用于查找第一个故事,然后由此块渲染。传递 CSF 文件中的完整导出集(不是默认导出!)。

¥Specifies which CSF file is used to find the first story, which is then rendered by this block. Pass the full set of exports from the CSF file (not the default export!).