Skip to content

Getting started

Setup

Install the package, import its three style sheets, and every component is ready.

1. The registry

The package is private to the organisation and comes from its registry. Your project's .npmrc sends the scope there and reads the token from the environment; never write a token into a file. The whole procedure, with the kind of token to make, is in the guide to installing the packages.

.npmrc
@elsikora:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}

2. The package

React 19 is its peer: the project brings its own.

Terminal
pnpm add @elsikora/keystone-ui-kit

3. The three sheets

The project's style sheet imports, in this order: the tokens, the fonts, Tailwind, then the kit's theme. The theme points Tailwind at the kit's components, so their classes are generated with yours.

styles.css
@import "@elsikora/keystone-ui-kit/tokens.css";
@import "@elsikora/keystone-ui-kit/fonts.css";
@import "tailwindcss";
@import "@elsikora/keystone-ui-kit/theme.css";

4. The theme switch

Light and dark follow the reader's system until they choose. The boot script sets the theme before the first paint, so a stored dark choice never flashes light; ModeToggle switches it.

__root.tsx
import { THEME_BOOT_SCRIPT } from "@elsikora/keystone-ui-kit";

// In the document's head, before anything paints:
<script dangerouslySetInnerHTML={{ __html: THEME_BOOT_SCRIPT }} />