格式化与代码
Storybook Story 生成器
CSF3 .stories.tsx file from a component name and props.
编辑注
Understanding · One story per component state.
本深度章节目前仅有英文版本。上方的转换工具支持您的语言;长篇说明文章尚未翻译。
常见问题
Quick answers.
›What is CSF3?
Component Story Format 3 is the latest standard for Storybook, using object-based exports rather than the older `storiesOf` or functional templates. It reduces boilerplate and improves compatibility with testing tools.
›Does this tool support TypeScript?
Yes. The generated output includes standard TypeScript interfaces and type definitions for `Meta` and `StoryObj` to ensure type safety within your IDE.
›Can I add multiple stories at once?
This tool generates a base file with a Primary story. You can manually duplicate the story object in your editor to create variations like 'Disabled' or 'Loading' states.
›Is my component code uploaded?
No. The generator works by taking the metadata you provide and formatting it into a string; no files are uploaded and no code analysis is performed on a server.
大家也在搜索
相关工具
More in this room.
- JSON 转 React Hook Form + Zod根据 JSON 结构生成类型化的表单 schema 和 useForm hook。
- JSON 转 Next.js Server Action带有 Zod 解析和 revalidatePath 的 Server Action。
- JSON 转 Prisma Schema Model从 JSON 示例生成 Prisma 模型块。
- JSON 转 Drizzle ORM SchemaDrizzle pgTable 定义,带有 $inferSelect / $inferInsert。
- JSON 转 TypeORM Entity带有装饰器和生成的 id 的 TypeORM @Entity 类。
- JSON 转 Mongoose Schema + Model带有时间戳和类型的 Mongoose Schema + 模型。