You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/shared-components/README.md
+134Lines changed: 134 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,140 @@ Most components should be written as [MVVM pattern](../../docs/MVVM.md) view
121
121
components. See existing components for examples. The exceptions are low level
122
122
components that don't need a view model.
123
123
124
+
### Write Storybook Stories
125
+
126
+
All components should have accompanying Storybook stories for documentation and visual testing. Stories are written in TypeScript using the [Component Story Format (CSF)](https://storybook.js.org/docs/api/csf).
127
+
128
+
#### Story File Structure
129
+
130
+
Place the story file next to the component with the `.stories.tsx` extension:
131
+
132
+
```
133
+
MyComponent/
134
+
├── MyComponent.tsx
135
+
├── MyComponent.module.css
136
+
└── MyComponent.stories.tsx
137
+
```
138
+
139
+
#### Regular Component Stories
140
+
141
+
For regular React components (non-MVVM), create stories by defining a meta object and story variations:
Thanks to this approach, we can directly use primitives in the story arguments instead of a view model object.
225
+
226
+
#### Linking Figma Designs
227
+
228
+
This package uses [@storybook/addon-designs](https://github.com/storybookjs/addon-designs) to embed Figma designs directly in Storybook. This helps developers compare their implementation with the design specs.
229
+
230
+
1.**Get the Figma URL**: Open your design in Figma, click "Share" → "Copy link"
231
+
2.**Add to story parameters**: Include the `design` object in the meta's `parameters`
0 commit comments