npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@khamudom/lumen-ui-react

v0.3.0

Published

A reusable React + TypeScript component library with accessible, themeable components

Readme

Lumen React

A reusable React + TypeScript component library for building dashboards and applications. Components are accessible by default, themeable via CSS variables, and tree-shakeable.

Package: @khamudom/lumen-ui-react

Installation

npm install @khamudom/lumen-ui-react

Peer dependencies:

npm install react react-dom

Usage

Import components from the package entry:

import { Button, Input, Card, CardHeader, CardTitle, CardContent, Badge } from "@khamudom/lumen-ui-react";
import "@khamudom/lumen-ui-react/styles.css";

Button

<Button variant="primary" onClick={() => console.log("clicked")}>
  Save changes
</Button>

<Button variant="destructive" loading>
  Deleting…
</Button>

<Button variant="outline" icon={<span>→</span>} iconPosition="end" fullWidth>
  Continue
</Button>

Input

<Input
  label="Email"
  type="email"
  placeholder="[email protected]"
  helperText="We'll never share your email."
/>

<Input label="Email" error="Enter a valid email address." />

Card

<Card>
  <CardHeader>
    <CardTitle>Revenue</CardTitle>
    <CardDescription>Last 30 days</CardDescription>
  </CardHeader>
  <CardContent>
    <p>$12,400</p>
  </CardContent>
</Card>

Badge

<Badge variant="success" appearance="tint">Active</Badge>

Theming

Lumen ships with light and dark palettes defined in tokens.css. Components read design tokens via CSS variables, so switching themes does not require separate component variants.

ThemeProvider (recommended)

Wrap your app with ThemeProvider to toggle themes at runtime:

import {
  ThemeProvider,
  Button,
  useTheme,
} from "@khamudom/lumen-ui-react";
import "@khamudom/lumen-ui-react/styles.css";

function ThemeToggle() {
  const { resolvedTheme, toggleTheme } = useTheme();

  return (
    <Button variant="outline" onClick={toggleTheme}>
      {resolvedTheme === "dark" ? "Light mode" : "Dark mode"}
    </Button>
  );
}

export function App() {
  return (
    <ThemeProvider defaultTheme="system">
      <ThemeToggle />
      {/* your app */}
    </ThemeProvider>
  );
}

ThemeProvider supports:

| Prop | Description | |------|-------------| | defaultTheme | "light", "dark", or "system" (default: "light") | | theme | Controlled theme preference | | onThemeChange | Callback when the user changes theme | | storageKey | Persist preference to localStorage (default: "lumen-theme", set false to disable) | | enableGlobalTheme | Apply theme to <html> and <body> (default: true) |

Manual theme switching

Without React, set the theme on the document root:

import { applyTheme } from "@khamudom/lumen-ui-react";

applyTheme("dark"); // or "light"

Or use CSS hooks directly:

<html data-lumen-theme="dark" class="lumen-dark">

Scoped dark mode works on any ancestor:

<div data-lumen-theme="dark" class="lumen-dark">
  <!-- dark-themed subtree -->
</div>

Custom tokens

Override globally:

:root {
  --lumen-color-primary: #7c3aed;
  --lumen-color-background: #0f172a;
  --lumen-color-text: #f8fafc;
}

Override a single component instance:

.my-custom-button {
  --lumen-button-bg: #000;
  --lumen-button-color: #fff;
}
<Button className="my-custom-button">Custom</Button>

Project structure

src/
  components/
    Button/
    Input/
    Card/
    Badge/
  styles/
    tokens.css      # Design tokens
    globals.css     # Base utilities
  hooks/
  utils/
  index.ts          # Barrel exports

Each component folder contains:

  • Component.tsx — implementation
  • Component.css — plain CSS with .lumen-* classes
  • Component.stories.tsx — Storybook docs
  • Component.test.tsx — Vitest tests
  • index.ts — public exports

Scripts

| Command | Description | |--------|-------------| | npm run dev | Build library in watch mode | | npm run build | Typecheck + production build to dist/ | | npm run storybook | Start Storybook on port 6006 | | npm run build-storybook | Static Storybook build | | npm run test | Run Vitest component tests | | npm run lint | ESLint | | npm run format | Prettier write |

Local development

git clone <repository-url>
cd lumen-react
npm install
npm run storybook

Linking into another app

From this package directory:

npm run build
npm link

In your consumer app:

npm link @khamudom/lumen-ui-react

Import styles in the consumer (if not bundled automatically):

import "@khamudom/lumen-ui-react/styles.css";

Publishing

  1. Update version in package.json
  2. Run npm run build and npm run test
  3. Log in to npm: npm login
  4. Publish: npm publish --access public

The files field publishes only dist/. React and React DOM remain peer dependencies.

Tech stack

  • React 18/19
  • TypeScript
  • Vite (library mode)
  • Storybook
  • Plain CSS + CSS variables
  • ESLint + Prettier
  • Vitest + Testing Library

License

MIT