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

odt-lightweight-ui

v1.3.1

Published

Clean, lightweight, and token-driven React UI component library for ODT

Readme

ODT Lightweight UI

UI component library for React and Next.js applications, styled with CSS Modules and customizable via CSS variables.

Storybook Documentation


Installation

npm install odt-lightweight-ui
# pnpm
pnpm add odt-lightweight-ui

# yarn
yarn add odt-lightweight-ui

# bun
bun add odt-lightweight-ui

Peer Dependencies

{
  "peerDependencies": {
    "react": ">=18.0.0",
    "react-dom": ">=18.0.0"
  }
}

Quick Start

1. Import Styles

Import the stylesheet in your root layout or application entrypoint:

// app/layout.tsx (Next.js) or src/main.tsx (Vite)
import "odt-lightweight-ui/styles.css";
import "./globals.css";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}

2. Basic Example

import {
  Button,
  Card,
  CardHeader,
  CardTitle,
  CardContent,
  CardFooter,
  Badge,
  Input,
  Switch,
  toast,
} from "odt-lightweight-ui";

export function AccountSettings() {
  return (
    <Card variant="elevated">
      <CardHeader action={<Badge color="primary" variant="subtle" dot>Active</Badge>}>
        <CardTitle>Account Configuration</CardTitle>
      </CardHeader>

      <CardContent style={{ display: "flex", flexDirection: "column", gap: "1rem" }}>
        <Input
          label="Display Name"
          placeholder="e.g. Alex River"
          defaultValue="Alex"
        />
        <Switch
          defaultChecked
          label="Two-Factor Authentication"
          description="Require hardware token on login"
        />
      </CardContent>

      <CardFooter style={{ display: "flex", justifyContent: "flex-end", gap: "0.5rem" }}>
        <Button variant="ghost">Cancel</Button>
        <Button
          variant="filled"
          color="primary"
          onClick={() => toast.success("Settings saved")}
        >
          Save Changes
        </Button>
      </CardFooter>
    </Card>
  );
}

3. Router Links (asChild)

Use asChild to pass styling and props to router link elements (such as Next.js <Link>):

import Link from "next/link";
import { Button } from "odt-lightweight-ui";

export function NavigationLink() {
  return (
    <Button asChild variant="filled" color="primary">
      <Link href="/dashboard">Go to Dashboard</Link>
    </Button>
  );
}

Theming & CSS Variables

All components use CSS variables defined on :root. You can override them in your stylesheet:

:root {
  --color-primary-500: hsl(220 90% 56%);
  --color-primary-600: hsl(220 90% 48%);
  --radius-xl: 0.75rem;
  --font-family-sans: "Inter", sans-serif;
}

Dark Mode

Dark mode is applied when .dark or [data-theme="dark"] is set on the <html> element:

.dark,
[data-theme="dark"] {
  --color-surface: hsl(224 25% 12%);
  --color-surface-muted: hsl(224 20% 16%);
  --color-fg: hsl(220 20% 90%);
  --color-line: hsl(224 14% 22%);
}

Tailwind CSS v4

To use with Tailwind CSS v4:

/* app/globals.css */
@import "tailwindcss";
@import "odt-lightweight-ui/tailwind.css";

Components

| Component | Variants | Key Props | | :--- | :--- | :--- | | Button | filled, frosted, capsule, ghost | size, color, asChild, loading, disabled, leftIcon, rightIcon | | Heading, Text | 5xlxs | as, size, weight, color, align | | Card | elevated, frosted, subtle, muted, outlined | hover, radius, border | | Badge | subtle, filled, outline | color, size, dot, icon, radius | | Avatar, AvatarGroup | primary, secondary, neutral | name, src, size, status | | Input | outlined, filled, frosted | label, error, helperText, leftIcon, rightIcon, clearable | | PasswordInput | outlined, filled, frosted | Visibility toggle, strengthMeter | | SearchInput | outlined, filled, frosted | Search icon, clear action | | PinInput | outlined, filled, frosted | length, type, auto-focus traversal | | TextArea | outlined, filled, frosted | rows, resize, showCount, maxLength | | Switch | Default | checked, onCheckedChange, label, description | | Checkbox | Default | checked, indeterminate, onCheckedChange, label, description | | RadioGroup, Radio | Default | value, onValueChange, orientation, label, description | | Modal | Dialog overlay | open, onClose, size, closeOnBackdropClick | | DropdownMenu | Popover menu | Nested items, shortcuts, checkboxes | | StatCard | Summary card | title, value, trend, progress, icon | | Toaster, toast | Toast alerts | toast.success(), toast.error(), toast.info() |


Integrations

  • Ruby on Rails: Rails Engine, ViewHelpers, and Stimulus controller via odt-ui-rails.

Development

# Build package (ESM, CJS, types, CSS)
npm run build

# Start Storybook
npm run storybook

# Typecheck
npm run type-check

License

MIT