@kivacore/bklit
v0.1.0
Published
Composable Bklit web charts, layers and React hooks
Readme
@kivacore/bklit
Composable React charts from Bklit UI, packaged as ESM with TypeScript declarations. Import the documented primitives from @kivacore/bklit or @kivacore/bklit/charts. Each web registry item also has its own import path, such as @kivacore/bklit/line-chart, @kivacore/bklit/sparkline, and @kivacore/bklit/legend.
Install
pnpm add @kivacore/bklit react react-domIn your Tailwind CSS v4 entry stylesheet, import the chart theme after Tailwind and your app theme. The stylesheet registers the distributed chart files for utility generation and supplies light and dark palettes. Tooltips pick up your shadcn popover colors when available and use the chart palette otherwise.
@import "tailwindcss";
@import "@kivacore/bklit/css";Example
Components imported from the root and individual entry points can be composed together.
import { ChartTooltip, Grid, XAxis } from '@kivacore/bklit';
import { Line, LineChart } from '@kivacore/bklit/line-chart';
const data = [
{ date: new Date('2026-01-01'), visits: 120 },
{ date: new Date('2026-01-02'), visits: 180 },
{ date: new Date('2026-01-03'), visits: 145 },
];
export function VisitsChart() {
return (
<LineChart data={data} style={{ height: 280 }}>
<Grid horizontal />
<Line dataKey="visits" />
<XAxis />
<ChartTooltip />
</LineChart>
);
}See the component catalog for chart families, props and examples. The theming guide covers palette overrides.
TypeScript compatibility. If you check dependency declarations and see a MotionStyle.pathLength conflict with Motion 12 and [email protected], pin csstype to 3.2.3 in your app's package manager overrides. This is the version used by this workspace and upstream Bklit.
Single HTML example with Preact
Open Countries by region in the Country Atlas example. Its native import map loads the packaged pie-chart entry and shares one Preact runtime with shadcn. Search for a country to update the chart.
Serve the HTML as written with any static HTTP server. From the monorepo root, python3 -m http.server 48765 --bind 127.0.0.1 --directory examples/mini-app serves it at http://127.0.0.1:48765/index.html.
Maintaining the package
The source comes from the MIT-licensed web chart library in bklit/bklit-ui. The package includes Bklit's MIT notice and the visx pattern notice in dist/.
From the monorepo root, run pnpm bklit:sync to regenerate the sources and entry points. To update upstream, change the commit in scripts/sync-bklit.mts, review dependency changes in upstream's packages/ui/package.json, then sync and build. A normal package build uses the checked-in sources.
pnpm --filter @kivacore/bklit build
pnpm --filter @kivacore/bklit pack