Sample.app
Framework Guides

Storybook

Deploy a Storybook to Sample.app.

Storybook builds to a static site by default, making it a great fit for Sample.app. Share your component library with your team via a preview URL.

Deploy

Build Storybook

npx storybook build

This outputs to storybook-static/ by default.

Deploy to Sample.app

samplex deploy ./storybook-static

storybook-static/ is not auto-detected by the CLI. You must specify the directory explicitly.

Custom output directory

You can change the output directory with the -o flag:

npx storybook build -o dist

Then auto-detection works:

samplex deploy

Use with a deploy script

Add a deploy script to your package.json so your team can deploy with one command:

package.json
{
  "scripts": {
    "deploy-storybook": "storybook build && samplex deploy ./storybook-static"
  }
}

On this page