PREVIEW
YOUR UI.
@domain-first/project-structure
Prepare Storybook on React + Vite through Project Structure, then generate UI components and widget stories in the same presentation layer.
Choose React + Vite Storybook.
npx df-psSelect Add integration → Storybook (React + Vite). This enables React scaffolding and sets storybookFramework to @storybook/react-vite.
This integration configures Storybook’s Vite builder. It does not generate a standalone Vite application or replace your application’s own dev/build setup.
A home for UI previews.
src/presentation/react/.storybook/
main.ts
preview.ts
src/presentation/react/storybook-static/
# output after the Storybook buildThe config uses relative story paths and includes @vitejs/plugin-react. Its Vite alias @ resolves to the project root containing package.json, computed from the config location. Add your project CSS to preview.ts through relative or @/ imports.
Install missing dependencies using the commands printed by the CLI. Existing dependencies must be compatible with the Storybook, Vite and React plugin versions you use.
Generate the UI and its story together.
After setup, generate a UI-kit component or a widget with separated UI. The generator creates a story skeleton alongside the rendering component. Add representative props, states and interaction scenarios.
npm run storybookThe generated development script opens Storybook on port 6006 using the presentation/react/.storybook configuration.
npm run build-storybookThe build script writes the static Storybook to presentation/react/storybook-static. The preset adds that output to .gitignore.
See React ↗ for the generated component and widget layouts.
Keep the surrounding project intact.
Unrelated scripts and package fields are preserved. Conflicting script names offer keep, replace or rename choices. Identical generated configuration is skipped on repeat setup; changed files require overwrite confirmation.
Setup writes configuration and prints commands. Run dependency installation, Storybook development and builds yourself.