React UI components and Storybook.
npm install
npm run dev # Storybook at http://localhost:6006
npm run build # Build static Storybook to storybook-static/
npm run build:lib # Build npm package to dist/- Bump
versioninpackage.jsonand commit. - Create a Release in the repo (e.g. tag
v1.0.0). The Publish to GitHub Packages workflow will build and publish tohttps://npm.pkg.github.com.
Or run the workflow manually: Actions → Publish to GitHub Packages → Run workflow.
In a project that uses @b2data/uikit, create or update .npmrc:
@b2data:registry=https://npm.pkg.github.com
To install from GitHub Packages you need auth (token with read:packages):
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
Then:
npm install @b2data/uikit@b2data/uikit– Core components (Button, Dialog, Input, etc.). Use this by default.@b2data/uikit/chart– Chart components (ChartContainer, ChartTooltip, etc.). Only pay for Chart and Recharts when you need them.@b2data/uikit/markdown– Markdown component. Only pay for Markdown when you need it.
import { Button } from "@b2data/uikit";
import { ChartContainer, ChartTooltip } from "@b2data/uikit/chart";
import { Markdown } from "@b2data/uikit/markdown";Import styles in your app:
import "@b2data/uikit/index.css";The project must have React 18+, Tailwind CSS v4, and the package’s peerDependencies / dependencies installed.
- In the repo: Settings → Pages
- Source: GitHub Actions
- On push to
main/master, the Deploy Storybook to GitHub Pages workflow builds and deploys Storybook.
URL: https://<owner>.github.io/<repo>/
BASE_PATH=/uikit/ npm run build(Replace uikit with your repository name.)