To ensure proper categorization in Storybook, use argTypes and parameters effectively.
argTypes
Categorize props into two acceptable categories:
- Subcomponent: All subcomponent props (including
children) should be specified under the associated subcomponent name. - "Story": Ancillary controls needed to stress the full flexibility of the component.
Use argTypes to rename props with subcomponent notation for clarity:
argTypes={{
hasHint: { name: Hint, table: { category: 'Story' } }
}}
parameters
Use parameters to link to Figma designs. This helps developers see the intended design for a specific story state.
args
Storybook provides main component props as args. For Garden boolean props that default to true, you must explicitly specify them in args to match the default behavior.