Skip to content

b2data/uikit

Repository files navigation

UIKit

React UI components and Storybook.

Setup and run

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/

Publishing to GitHub Packages (npm registry)

  1. Bump version in package.json and commit.
  2. Create a Release in the repo (e.g. tag v1.0.0). The Publish to GitHub Packages workflow will build and publish to https://npm.pkg.github.com.

Or run the workflow manually: Actions → Publish to GitHub Packages → Run workflow.

Installing the package in another project

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

Entry points

  • @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.

GitHub Pages

  1. In the repo: Settings → Pages
  2. Source: GitHub Actions
  3. On push to main/master, the Deploy Storybook to GitHub Pages workflow builds and deploys Storybook.

URL: https://<owner>.github.io/<repo>/

Local build for GitHub Pages

BASE_PATH=/uikit/ npm run build

(Replace uikit with your repository name.)

Releases

No releases published

Packages

 
 
 

Contributors