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: .storybook/README.md
+40-1Lines changed: 40 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,44 @@ export const WithVariant: Story = {
93
93
94
94
## Development Tips
95
95
96
+
## ComfyUI Storybook Guidelines
97
+
98
+
### Scope – When to Create Stories
99
+
-**PrimeVue components**:
100
+
No need to create stories. Just refer to the official PrimeVue documentation.
101
+
-**Custom shared components (design system components)**:
102
+
Always create stories. These components are built in collaboration with designers, and Storybook serves as both documentation and a communication tool.
103
+
-**Container components (logic-heavy)**:
104
+
Do not create stories. Only the underlying pure UI components should be included in Storybook.
105
+
106
+
### Maintenance Philosophy
107
+
- Stories are lightweight and generally stable.
108
+
Once created, they rarely need updates unless:
109
+
- The design changes
110
+
- New props (e.g. size, color variants) are introduced
111
+
- For existing usage patterns, simply copy real code examples into Storybook to create stories.
112
+
113
+
### File Placement
114
+
- Keep `*.stories.ts` files at the **same level as the component** (similar to test files).
115
+
- This makes it easier to check usage examples without navigating to another directory.
116
+
117
+
### Developer/Designer Workflow
118
+
-**UI vs Container**: Separate pure UI components from container components.
119
+
Only UI components should live in Storybook.
120
+
-**Communication Tool**: Storybook is not just about code quality—it enables designers and developers to see:
121
+
- Which props exist
122
+
- What cases are covered
123
+
- How variants (e.g. size, colors) look in isolation
124
+
-**Example**:
125
+
`PackActionButton.vue` wraps a PrimeVue button with additional logic.
126
+
→ Only create a story for the base UI button, not for the wrapper.
127
+
128
+
### Suggested Workflow
129
+
1. Use PrimeVue docs for standard components
130
+
2. Use Storybook for **shared/custom components** that define our design system
131
+
3. Keep story files alongside components
132
+
4. When in doubt, focus on components reused across the app or those that need to be showcased to designers
133
+
96
134
### Best Practices
97
135
98
136
1.**Keep Stories Simple**: Each story should demonstrate one specific use case
@@ -135,6 +173,7 @@ export const WithLongText: Story = {
135
173
-**`main.ts`**: Core Storybook configuration and Vite integration
136
174
-**`preview.ts`**: Global decorators, parameters, and Vue app setup
-**`preview-head.html`**: Injects custom HTML into the `<head>` of every Storybook iframe (used for global styles, fonts, or fixes for iframe-specific issues)
138
177
139
178
## Chromatic Visual Testing
140
179
@@ -170,4 +209,4 @@ This Storybook setup includes:
170
209
- PrimeVue component library integration
171
210
- Proper alias resolution for `@/` imports
172
211
173
-
For component-specific examples, see the NodePreview stories in `src/components/node/`.
212
+
For component-specific examples, see the NodePreview stories in `src/components/node/`.
0 commit comments