Installation
One package. A shared foundation for your apps.
1. Authenticate
GitHub Packages requires authentication even for public npm packages. Create a classic GitHub token with read:packages using an account that can access the package. Configure the registry with an environment-variable placeholder, never the token itself.
@jnpll:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}Supply NODE_AUTH_TOKEN in your shell before installing. This Bash/zsh prompt keeps the token out of shell history and terminal output. npm does not load Next.js .env.local files.
printf 'GitHub package token: '
read -rs NODE_AUTH_TOKEN
printf '\n'
export NODE_AUTH_TOKEN2. Add the dependency
Version 0.4.1 is available from GitHub Packages. React 19 and Tailwind CSS 4 are required. No local library checkout is needed.
npm install @jnpll/elements-ui@0.4.13. Connect the theme
Import the stylesheet in your global CSS, after Tailwind. Adjust the source path relative to that file so Tailwind scans the package classes.
@import "tailwindcss";
@import "@jnpll/elements-ui/themes.css";
@source "../../node_modules/@jnpll/elements-ui/dist";4. Import a component
import { Button } from "@jnpll/elements-ui/button";
export function SaveAction() {
return <Button>Save changes</Button>;
}Import components through their package exports. For Next.js, place interactive examples in a client component. Add the dark class to the document element for dark mode.
Deploy to Vercel
Create a dedicated classic GitHub token with only read:packages. In your Vercel project settings, add NODE_AUTH_TOKEN as a sensitive environment variable for Production and Preview, then redeploy. Keep the token out of source control and never prefix it with NEXT_PUBLIC_. The .npmrc above authenticates package installation during the build.
Theme switching
Available in version 0.4.1. The themes.css import loads all bundled palettes. Wrap your app once with the provider; the selector applies and remembers a palette without changing light/dark mode.
"use client";
import { ElementsThemeProvider } from "@jnpll/elements-ui/theme-provider";
import { ThemeSelector } from "@jnpll/elements-ui/theme-selector";
export function App({ children }) {
return <ElementsThemeProvider storageKey="my-app-design">
<ThemeSelector />
{children}
</ElementsThemeProvider>;
}import { useElementsTheme } from "@jnpll/elements-ui/theme-provider";
const { selection, setTheme } = useElementsTheme();
setTheme({ theme: "britanniae", palette: "arthur" });Use semantic color and geometry tokens throughout your app. Customize defaultSelection, storageKey, persist, or the themes registry on the provider. For server-rendered apps, insert getElementsThemeScript from the themes export in the document head using the same options to restore selections before paint.