f0-storybook-stories

Generate .stories.tsx files for F0 React components with meta, args, and argTypes.

27|5|Updated Mar 20, 2024
One-click install
npx skills add https://github.com/factorialco/f0 --skill f0-storybook-stories
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: f0-storybook-stories
Source: https://github.com/factorialco/f0/tree/main/packages/react/.skills/f0-storybook-stories
Command: npx skills add https://github.com/factorialco/f0 --skill f0-storybook-stories

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation of Storybook story files (.stories.tsx) for F0 React components, ensuring consistency and maintainability in your design system documentation.

Core Features & Use Cases

  • Automated Story Creation: Generates .stories.tsx files, including meta definitions, argTypes, and basic story structures.
  • Consistency Enforcement: Adheres to F0's Storybook best practices for meta definitions, tags, and argTypes.
  • Use Case: When developing a new F0 button component, use this Skill to quickly scaffold its Storybook stories, including defining variants, sizes, and interaction states.

Quick Start

Use the f0-storybook-stories skill to create a new story file for the F0Card component.

Frequently Asked Questions about f0-storybook-stories

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Storybook stories for React components?

To generate Storybook stories for React components, you can automatically create `.stories.tsx` files that define meta, component, tags, args, and argTypes according to established patterns for consistency.

What is the best way to structure Storybook argTypes for a design system?

Structuring Storybook argTypes for a design system involves defining component variants, sizes, and interaction states within `.stories.tsx` files, ensuring consistent documentation and maintainability across your React component library.

Does this Storybook story generation approach support snapshot testing?

Yes, the Storybook story generation process supports snapshot testing opt-in, allowing you to validate component rendering and capture visual changes while utilizing Storybook's React Vite builder and testing utilities.

Can I use decorators and internal stories with generated Storybook files?

Yes, the generated `.stories.tsx` files provide guidance on using decorators and internal stories, allowing you to wrap components with necessary context providers or mock data for comprehensive component development and documentation.

Why define tags and meta in Storybook stories?

Defining tags and meta in Storybook stories enforces best practices and consistency across your design system documentation, ensuring that each React component is properly categorized, documented, and easily discoverable.