A Vite plugin for React

Your components,on display.

Add /** @preview */ above a component. It appears in a live gallery, rendered by the Vite dev server you already run. Nothing changes in your production build.

Try the live demo
Button.tsx
import { Button } from "./Button";
Save
No. 01PrimaryInputs
toneprimarydangerghost
children"Save"
disabled

Select a preview to update the gallery

Why Vitrine

Stop clicking through your app to check one toast.

localhost:5173/loginlocalhost:5173/productslocalhost:5173/cartlocalhost:5173/checkoutlocalhost:5173/checkout/payment

5clicks to see one toast

And it's gone after three seconds.

Log in, fill the cart, enter a card and make the payment fail on purpose. Then start over for the warning and the long message.

What changes

Add it for yourself.
Your team feels it too.

Fewer screenshots, fewer screen shares, fewer “can you run it on your machine?”

For you

  • One line in your configvite.config.ts

    Add it to the Vite config you already have. Aliases and CSS just work, and your production build stays the same.

  • Components before pagesargs

    Build and check a component with sample props before the page or the API exists.

  • Props from your typesTypeScript

    Controls are generated from your component's props, so there is nothing to keep in sync by hand.

  • Follows your cursorVS Code, optional

    In VS Code the panel switches to the preview you are editing. The browser gallery works fine on its own.

And your team stops asking you

# design

Mina DesignerHow does the publish button look when it's disabled?
YouHere's exactly that state:localhost:5173/__vitrine#preview=Button&args={"disabled":true}

localhost:5173/__vitrine

Publishdisabled: true

Features

Work with previews more easily.

Props controlsfrom your types

Controls are generated from prop types, including types imported from other files.

interface ButtonProps {
  tone: "primary" | "danger";
  disabled?: boolean;
}

How it works

Start with one comment.

Components render in your own Vite setup, with your aliases, plugins, CSS and HMR.

  1. No. 01Mark a preview/** @preview */

    Add the comment above an exported component. The preview stays with its source.

  2. No. 02Run the servervite dev

    Add the plugin and start your dev server as usual. Vitrine only runs during development.

  3. No. 03Open the gallery/__vitrine

    Use it in a browser, or beside your editor with the VS Code extension.

Compatibility

Fits the setup you already have.

Supports React 18 and 19 and Vite 6.4 and later. Previews use your Vite config, so aliases, CSS and plugins behave as they do in your app.

FAQ

Common questions.

Does Vitrine change my production build?

No. The plugin only runs during vite serve and adds nothing to your build output. The static gallery is built by a separate command.

Can I deploy the gallery?

Yes. Add vitrine-plugin-static and run vitrine-static build to get a folder you can upload to any static host.

Do I need the VS Code extension?

No. The gallery works in any browser at /__vitrine. The extension adds a side panel that follows your cursor.

Why does a .vitrine folder appear in my project?

The plugin writes its port there so the extension can find your dev server. The folder ignores itself, so it never shows up in commits.

Something is not working. Where do I report it?

Open an issue on GitHub with your React and Vite versions

Put your first component on display.

One install, one line in vite.config, one comment.