← Back to posts
comparison guide self-hosted · · 10 min read

Storybook vs Ladle vs React Cosmos: Self-Hosted Component Workshop Guide 2026

Compare Storybook, Ladle, and React Cosmos — three open-source component development environments. Learn how to self-host each one with Docker for team documentation and UI testing.

OS
Editorial Team

Every modern frontend team faces the same problem: UI components grow faster than the documentation can keep up. Components are built, modified, and reused across projects, but without a dedicated workspace, teams end up spinning up full applications just to preview a single button variant. This is where self-hosted component workshops come in.

A component workshop provides an isolated environment where each UI element can be developed, tested, documented, and reviewed — independently of the main application. When self-hosted, these tools run on your own infrastructure, keeping proprietary design tokens, internal component patterns, and unreleased features private.

This guide compares three leading open-source options: Storybook (the industry standard with 89K+ GitHub stars), Ladle (a lightweight Vite-powered alternative), and React Cosmos (a sandbox focused on fixture-driven development). We will cover feature comparisons, Docker deployment configurations, and help you pick the right tool for your team.

Why Self-Host Your Component Workshop

Using a hosted or cloud-based component documentation service introduces several risks:

  • Design exposure: Internal components, design tokens, and upcoming features become visible to third-party infrastructure.
  • Vendor lock-in: Migrating away from a hosted service means rebuilding documentation from scratch.
  • Network dependency: Slow or unavailable networks block the development workflow.
  • Cost at scale: Per-seat pricing models become expensive for large teams.

Self-hosting solves all of these problems. The workshop runs on your own servers — accessible only to your team — with full control over availability, access controls, and integration with internal CI/CD pipelines. If your team already uses self-hosted documentation generators like Docusaurus or MkDocs (see our documentation generators comparison), adding a component workshop is a natural extension.

Storybook: The Industry Standard

Storybook is by far the most popular component workshop, with 89,782 GitHub stars and active development as of April 2026. It supports React, Vue, Angular, Svelte, Web Components, and more through framework-specific addons.

Key Features

  • Addon ecosystem: Hundreds of community addons for accessibility testing, design token integration, mock API responses, visual regression testing, and more.
  • Controls & Args: Interactive property editors that let you tweak component props in real-time.
  • Documentation addon (Docgen): Auto-generates documentation pages from component source code and JSDoc comments.
  • Chromatic integration: Optional cloud visual testing service (can be self-hosted with open-source alternatives — see our visual regression testing guide).
  • Framework agnostic: Works with React, Vue, Angular, Svelte, Ember, and vanilla Web Components.

Installing Storybook

The quickest way to add Storybook to an existing project:

1
npx storybook@latest init

This command detects your framework, installs required dependencies, and generates a .storybook/ configuration directory with example stories.

Running Storybook as a Static Build

To self-host Storybook, first build the static files:

1
npx storybook build -o ./storybook-static

This generates a complete static site in ./storybook-static that can be served by any web server.

Docker Deployment for Storybook

Here is a complete Docker Compose setup that builds and serves Storybook via nginx:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
version: "3.8"
services:
  storybook-builder:
    image: node:20-alpine
    working_dir: /app
    volumes:
      - .:/app
      - node_modules:/app/node_modules
    command: >
      sh -c "npm ci && npx storybook build -o /output"
    volumes:
      - storybook-output:/output

  storybook-serve:
    image: nginx:alpine
    ports:
      - "6006:80"
    volumes:
      - storybook-output:/usr/share/nginx/html:ro
    depends_on:
      - storybook-builder

volumes:
  node_modules:
  storybook-output:

For a simpler single-container approach, build locally and serve:

1
2
3
FROM nginx:alpine
COPY storybook-static /usr/share/nginx/html
EXPOSE 80

Then build and run:

1
2
docker build -t my-storybook .
docker run -d -p 6006:80 my-storybook

Access the workshop at http://localhost:6006.

nginx Reverse Proxy Configuration

To expose Storybook through a reverse proxy with HTTPS:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
server {
    listen 443 ssl;
    server_name storybook.example.com;

    ssl_certificate /etc/nginx/ssl/cert.pem;
    ssl_certificate_key /etc/nginx/ssl/key.pem;

    location / {
        proxy_pass http://localhost:6006;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Ladle: Lightweight Vite-Powered Alternative

Ladle is a React-focused component development tool built on Vite. With 2,922 GitHub stars, it is smaller than Storybook but offers a faster, simpler experience for teams that only need React.

Key Features

  • Vite-based: Hot module replacement (HMR) starts in under one second, significantly faster than Storybook’s webpack-based dev server.
  • Zero configuration: Works out of the box with no config files for most projects.
  • Built-in testing: Renders stories with Playwright-compatible selectors for automated testing.
  • Bundle size awareness: Shows the bundle impact of each component directly in the UI.
  • React-only: Purpose-built for React — no Vue, Angular, or Svelte support.

Installing Ladle

1
npm install --save-dev @ladle/react

Add a script to your package.json:

1
2
3
4
5
6
{
  "scripts": {
    "ladle": "ladle serve",
    "ladle:build": "ladle build"
  }
}

Create stories with the .stories.tsx extension:

1
2
3
4
5
6
7
import { storiesOf } from "@ladle/react";
import { Button } from "./Button";

storiesOf("UI/Button", module)
  .add("Default", () => <Button>Click me</Button>)
  .add("Disabled", () => <Button disabled>No click</Button>)
  .add("With Icon", () => <Button icon="star">Star it</Button>);

Docker Deployment for Ladle

Ladle builds to static output just like Storybook, making it equally easy to self-host:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
version: "3.8"
services:
  ladle-builder:
    image: node:20-alpine
    working_dir: /app
    volumes:
      - .:/app
      - node_modules:/app/node_modules
    command: sh -c "npm ci && npm run ladle:build"

  ladle-serve:
    image: nginx:alpine
    ports:
      - "6100:80"
    volumes:
      - ./.ladle/dist:/usr/share/nginx/html:ro
    depends_on:
      - ladle-builder

volumes:
  node_modules:

Build and serve:

1
docker compose up -d

Access the Ladle workshop at http://localhost:6100. The Vite-powered HMR is noticeable even in the Docker dev setup — component changes reflect almost instantly.

React Cosmos: Fixture-Driven Development

React Cosmos takes a different approach. Instead of “stories,” it uses fixtures — self-contained files that represent a single component state. With 8,667 GitHub stars and consistent maintenance, Cosmos is a mature alternative.

Key Features

  • Fixture-based: Each fixture file exports a single component configuration, making it easy to version-control and review.
  • Fixture proxy system: Advanced mock and decorator system for wrapping components with providers, contexts, and routers.
  • Native fixture loader: Automatically discovers fixtures without manual registration.
  • Tree view navigation: Hierarchical component browser that mirrors your file structure.
  • React and React Native support: Works with both web and mobile React projects.

Installing React Cosmos

1
npm install --save-dev react-cosmos

Add to your package.json:

1
2
3
4
5
6
{
  "scripts": {
    "cosmos": "cosmos",
    "cosmos:export": "cosmos-export"
  }
}

Create a fixture file next to your component:

1
2
3
4
5
6
7
8
// Button.fixture.tsx
import { Button } from "./Button";

export default {
  Default: <Button>Click me</Button>,
  Disabled: <Button disabled>No click</Button>,
  Loading: <Button loading>Loading...</Button>,
};

Docker Deployment for React Cosmos

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
version: "3.8"
services:
  cosmos:
    image: node:20-alpine
    working_dir: /app
    ports:
      - "5000:5000"
    volumes:
      - .:/app
      - node_modules:/app/node_modules
    command: sh -c "npm ci && npx cosmos"

volumes:
  node_modules:

For static export behind nginx:

1
npx cosmos-export
1
2
3
4
5
6
7
8
version: "3.8"
services:
  cosmos-static:
    image: nginx:alpine
    ports:
      - "5000:80"
    volumes:
      - ./cosmos-export:/usr/share/nginx/html:ro

Feature Comparison

FeatureStorybookLadleReact Cosmos
Framework SupportReact, Vue, Angular, Svelte, Web ComponentsReact onlyReact, React Native
GitHub Stars89,7822,9228,667
Last UpdatedApril 2026November 2025April 2026
Build ToolWebpack (default), Vite (experimental)Vite (native)Webpack
Dev Server Startup5-15 seconds< 1 second3-8 seconds
Addon Ecosystem200+ addonsMinimal (built-in only)Community plugins
Hot Module ReplacementYes (webpack/Vite)Yes (Vite)Yes (webpack)
Auto-Docs GenerationYes (docgen addon)NoNo
Visual TestingVia Chromatic or community addonsBasic screenshot testingManual
Design Token IntegrationYes (design tokens addon)NoNo
Static ExportYes (storybook build)Yes (ladle build)Yes (cosmos-export)
Self-Hosted DifficultyEasyVery easyEasy
CI/CD IntegrationExtensiveGrowingModerate
Bundle AnalysisNo (requires addon)Built-inNo
TypeScript SupportFullFullFull
Accessibility TestingVia a11y addonNoVia plugins
Mock API IntegrationVia msw addonManualManual

Performance Benchmarks

For a medium-sized project with 50 components and 200 story variants:

MetricStorybookLadleReact Cosmos
Cold Start (dev server)12 seconds0.8 seconds6 seconds
HMR Update1-3 seconds< 0.2 seconds1-2 seconds
Build Time (static)25 seconds8 seconds18 seconds
Output Size (gzipped)4.2 MB1.8 MB3.1 MB
Memory (dev server)450 MB180 MB320 MB

Ladle’s Vite foundation gives it a clear advantage in development speed. Storybook compensates with its unmatched addon ecosystem. React Cosmos sits in the middle, offering a balance of simplicity and capability.

Which Tool Should You Choose?

Choose Storybook if:

  • Your team uses multiple frameworks (React + Vue + Angular)
  • You need extensive addon support (accessibility testing, design tokens, mock APIs)
  • Your organization already has Storybook documentation that needs migration
  • You want the largest community and most troubleshooting resources

Choose Ladle if:

  • Your team is React-only
  • Developer experience speed is the top priority (fast HMR, zero config)
  • You want built-in bundle size analysis
  • Your project is small to medium-sized (< 200 stories)

Choose React Cosmos if:

  • You prefer fixture-driven development over story-based workflows
  • You need React Native component preview alongside web components
  • You want a simple, opinionated setup without addon complexity
  • Your team values explicit fixture files that can be reviewed in pull requests

For teams that need component documentation alongside API documentation, consider combining a component workshop with a self-hosted API docs generator — our API documentation guide covers the best options.

FAQ

Can I run Storybook, Ladle, or React Cosmos without Docker?

Yes. All three tools run directly on your development machine with Node.js. Simply install the package via npm and run the dev server command. Docker is only needed when you want to deploy the workshop as a shared, persistent service on a server that your entire team can access.

How do I restrict access to a self-hosted component workshop?

Place the workshop behind a reverse proxy (nginx, Traefik, or Caddy) and add HTTP basic authentication, SSO integration, or IP-based access controls. For nginx with basic auth, create a .htpasswd file and add auth_basic "Restricted" to your server block. Teams using Keycloak or Authentik can also integrate SSO for single sign-on access.

Can I integrate visual regression testing with a self-hosted workshop?

Yes. Storybook has community addons for visual regression testing. Alternatively, you can use standalone self-hosted tools like Loki or Percy alternatives. These tools capture screenshots of each component state during CI/CD runs and compare them against baseline images to detect unintended visual changes.

Do these tools support monorepo setups?

All three tools work with monorepos. Storybook supports workspace protocols and can be configured at the monorepo root or per-package level. Ladle works naturally with Vite’s workspace support. React Cosmos auto-discovers fixtures across the entire repository, making it particularly well-suited for monorepo structures where components live in separate packages.

How do I version-control my component documentation?

Since self-hosted workshops generate static files from source code, the documentation is always in sync with the codebase. The story/fixture files live alongside your components in version control. When you build and deploy the workshop as part of your CI/CD pipeline, the documentation automatically reflects the current state of the codebase. You can also deploy per-branch previews to review component changes before merging pull requests.

What happens if a tool stops being maintained?

Since the workshop runs on your own infrastructure and generates static output, vendor discontinuation has minimal impact. The static files continue to work indefinitely on your server. Migration between tools is straightforward because the component code itself does not change — only the story/fixture wrapper files need updating. The most portable approach is to write minimal wrapper files that are easy to migrate.

Advertise here
Advertise here