Page Builder
Storybook Builder is a visual editor for creating pages and prototypes using existing Storybook components. It lets teams combine, nest, and configure components quickly, preview changes instantly, and turn ideas into reusable UI faster.
Storybook Page Builder
storybook-page-builder is a React-focused Storybook 9 addon that adds a visual page builder tab powered by Puck. It lets teams prototype real features and pages from the components already documented in Storybook.
Features
- Discovers component-backed Storybook stories and exposes them as Puck components
- Maps primitive Storybook
argsandargTypesto editable Puck fields - Supports
parameters.pageBuilderfor labels, categories, field overrides, defaults, filtering, descriptions, and explicit slots - Renders the actual React components in the builder canvas
- Provides layout primitives for sections, stacks, grids, and nested slots
- Saves multiple named builds in browser
localStorage - Supports build save, save as, load, duplicate, delete, JSON import, and JSON export
- Includes mobile, tablet, desktop, and full-width canvas viewports
Compatibility
- Storybook:
^9.0.0 - React:
>=18 <20 - Frameworks: React Storybooks, including
@storybook/react-vite
The addon is browser-local by design. Saved builds are stored in localStorage, and exported JSON files are the portability mechanism for sharing or backing up prototypes.
Install
npm install --save-dev storybook-page-builder
Register the addon in your Storybook config:
import type { StorybookConfig } from '@storybook/react-vite';
const config: StorybookConfig = {
framework: '@storybook/react-vite',
addons: ['storybook-page-builder'],
};
export default config;
Start Storybook and open the Page Builder tab.
How Discovery Works
The addon reads Storybook metadata from the preview runtime, where resolved args, argTypes, and story parameters are available. Component-backed stories become builder entries, deduplicated by component title.
For inferred fields, the addon supports primitive, serializable controls:
stringtotextortextareabooleanto a boolean radio fieldnumbertonumber- enum/select/radio controls to
selectorradio
Complex props are skipped for editable fields and iframe args:
- functions
- objects and arrays
- render props
ReactNode- implicit
children
The component still appears in the builder even when some props are skipped.
Page Builder Parameters
Stories can customize builder behavior with parameters.pageBuilder on meta or individual stories.
import type { Meta, StoryObj } from '@storybook/react';
import { Button } from './Button';
const meta = {
component: Button,
title: 'Forms/Button',
parameters: {
pageBuilder: {
category: 'Marketing',
excludeArgs: ['onClick'],
},
},
} satisfies Meta<typeof Button>;
export default meta;
export const Primary: StoryObj<typeof meta> = {
args: {
label: 'Save changes',
primary: true,
},
parameters: {
pageBuilder: {
label: 'Primary Button',
defaultProps: {
label: 'Start prototype',
},
},
},
};
Supported keys:
enabledlabelcategoryfieldsdefaultPropsincludeArgsexcludeArgsdescriptionslots
fields overrides inferred Puck fields. defaultProps override story args for new builder blocks. includeArgs and excludeArgs filter which props become editable fields. slots are explicit-only in this release; the addon does not infer layout regions automatically.
Build Library
The Page Builder keeps the current draft autosaved and also provides a local build catalog:
Saveupdates the active build and increases its revisionSave ascreates a named copyBuildsopens the local build libraryImportaccepts an exported build JSON payloadExportdownloads the active build as JSONJSONopens the current builder payload for manual inspection or import
Imported and loaded builds are normalized against the current component registry. If a component type no longer exists, that block is ignored instead of breaking the canvas.
Development
pnpm install
pnpm start
Useful scripts:
pnpm buildbuilds the addon package intodistpnpm build-storybook -- --test --quietverifies the addon in a production Storybook buildpnpm lintruns ESLintnpm run prereleasechecks publish metadatanpm_config_cache=/private/tmp/storybook-builder-npm-cache npm pack --dry-runpreviews the npm tarball contents
Publishing
This repository is prepared for the Storybook Addon Kit release flow:
pnpm run releaseruns the package build andauto shipit- GitHub Actions publishes through
.github/workflows/release.yml - The package requires an
NPM_TOKENrepository secret before publishing - Release PRs should be labeled for Auto, for example
minorfor the first0.1.0release