web/.storybook/Introduction.mdx
import { Meta } from "@storybook/blocks";
<Meta title="Getting Started" />A living catalog for browsing, testing, and documenting Onyx UI components in isolation.
This Storybook contains interactive examples of every reusable UI component in the Onyx frontend. Each component has a dedicated page with:
The left sidebar organizes components by layer:
Interactive, Hoverable)Button, OpenButton, Tag)Content, ContentAction, IllustrationContent)Click any component to see its stories. Click Docs to see the auto-generated props table.
At the bottom of each story, the Controls panel lets you change props in real time. Toggle booleans, pick from enums, type in strings — the preview updates instantly.
Use the paint roller icon in the top toolbar to switch between light and dark mode. All components use CSS variables that automatically adapt.
cd web
npm run storybook # dev server on :6006
npm run storybook:build # static build to storybook-static/
Stories are co-located next to their component:
lib/opal/src/components/buttons/Button/
├── components.tsx ← the component
├── Button.stories.tsx ← the story
├── styles.css
└── README.md
import type { Meta, StoryObj } from "@storybook/react";
import { MyComponent } from "./MyComponent";
const meta: Meta<typeof MyComponent> = {
title: "opal/components/MyComponent", // sidebar path
component: MyComponent,
tags: ["autodocs"], // auto-generate docs page
};
export default meta;
type Story = StoryObj<typeof MyComponent>;
export const Default: Story = {
args: {
title: "Hello",
},
};
export const WithCustomLayout: Story = {
render: () => (
<div className="flex gap-2">
<MyComponent title="One" />
<MyComponent title="Two" />
</div>
),
};
opal/core/Name, opal/components/Name, Layouts/Name, or refresh-components/Nametags: ["autodocs"] to auto-generate a docs page from propsTooltipPrimitive.Provider (anything with tooltips), add it as a decoratorparameters: { layout: "fullscreen" } for modals/popovers that use portalsProduction builds deploy to onyx-storybook.vercel.app automatically when PRs touching component files merge to main.
Monitored paths:
web/lib/opal/**web/src/refresh-components/**web/.storybook/**