- At
repository root
locationnpm i
: Install node modules and set Nx environmentnx storybook @lunit/design-system
: Runs storybook local dev server on http://localhost:6006
A story is simply a case in which one component is executable.
You can browse the stories in the UI and see the code behind them in files that end with .stories.js(jsx)
or .stories.ts(tsx)
.
// Button.stories.js|jsx
import React from "react";
import { Button } from "./Button";
export default {
/* 👇 The title controls the name shown in the storybook sidebar. */
title: "Components/Button",
component: Button,
};
export const Primary = () => <Button primary>Button</Button>;
Documentation can be found Storybook's docs site.