new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

Storybook · API · all subjects

csf fields & export structure

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Story file path for NotificationsList component

Storybook stories for the NotificationsList component should be created in the file stories/NotificationsList.stories.tsx.

Annotations can be set at three levels

Story annotations can be set at the project level in preview.js or via addons, at the component level via export default in a CSF file, or at the story level via export const Story in a CSF file. Not all annotations can be set at every level but most can.

Story type excludes mutable fields from StoryContext

The Story type includes all fields from StoryContext except for args, globals, hooks, and viewMode, which are mutable and stored separately in the store.

Story identifying fields

A Story has four identifying fields: componentId (the URL id of the component), title (the title that generates the sidebar entry), id (the story id in the URL), and name (the name of the story).

Story function receives args and context as parameters

By default, args are passed to the story function as the first argument and the context as the second argument. Example: const YourStory = ({ x, y } /*, context*/) => /* render your story using `x` and `y` */

Give your agent this brain