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

@dain-os/ui

v0.10.0

Published

DainOS master design system: universal components shared across DainOS and client apps (PRD-094).

Readme

@dain-os/ui

The DainOS master design system: universal, themeable React components shared across DainOS and client apps. Ships compiled ESM plus the design-token CSS layers. Built for Tailwind v4 and React 19.

Install

npm install @dain-os/ui

Peer dependencies you provide: react and react-dom (v19). react-hook-form (v7) is an optional peer, needed only if you use the Form atom.

Tailwind v4 setup

@dain-os/ui ships compiled components that reference Tailwind utility classes (bg-primary, inline-flex, and so on). Two things have to happen in your app's Tailwind v4 stylesheet for those to render:

  1. Scan the package so Tailwind generates the utilities the components use.
  2. Import the token layers so those utilities resolve to real colours, radii, and motion values.
/* app.css (your Tailwind v4 entry) */
@import 'tailwindcss';

/* 1. Generate the utility classes the compiled components reference.
      The path is relative to THIS file; adjust the depth to your node_modules. */
@source '../node_modules/@dain-os/ui/dist/**/*.js';

/* 2. Token layers, in this order. */

/* Raw design tokens (neutral black-and-white default). */
@import '@dain-os/ui/styles/tokens.css';

/* Optional client brand overlay: re-declare the token vars with your colours,
   AFTER tokens.css so the cascade picks up your values. */
/* @import './my-brand-tokens.css'; */

/* Density modes (optional). Activate kiosk sizing with
   <html data-density="kiosk">. Safe to import even if you never set it. */
@import '@dain-os/ui/styles/density.css';

/* Token-to-utility contract: maps the tokens above to Tailwind utilities. */
@import '@dain-os/ui/styles/theme.css';

/* Reduced-motion contract. MUST come after any brand overlay, because it
   re-declares the motion duration tokens and relies on cascade order. */
@import '@dain-os/ui/styles/base.css';

The four CSS layers:

| Layer | Subpath | What it carries | |---|---|---| | Tokens | @dain-os/ui/styles/tokens.css | Raw OkLCH colour, radius, shadow and motion tokens (the swappable, per-client layer) | | Theme | @dain-os/ui/styles/theme.css | The @theme inline token-to-utility contract, motion utilities and keyframes | | Base | @dain-os/ui/styles/base.css | The reduced-motion contract (clamps every motion token under prefers-reduced-motion) | | Density | @dain-os/ui/styles/density.css | Kiosk density mode, activated by data-density="kiosk" on the root element |

Usage

Import from a layer barrel, or from a granular component subpath for the narrowest dependency:

// Layer barrel
import { Button, Card, Badge } from '@dain-os/ui/atoms';

// Granular subpath
import { Button } from '@dain-os/ui/atoms/button';

export function Example() {
  return <Button>Get started</Button>;
}

Available layers: @dain-os/ui/atoms, /molecules, /organisms, /layout, /hooks. Each component and hook is also exposed at its own subpath (for example @dain-os/ui/layout/page, @dain-os/ui/hooks/use-mobile).

React Server Components

@dain-os/ui is safe to use in React Server Component trees, including the Next.js App Router. Client components (anything that uses hooks, context or browser APIs, for example Dialog, Sidebar and Select) keep their 'use client' directive in the published build, on every import path: the granular subpath, the layer barrel and the root barrel all preserve the client boundary. You can import a client component straight into a server component without a boundary error. Server-safe components such as Button carry no directive, so they stay renderable on the server.

Versioning

0.x while the component surface is still settling. The published API may change between minor versions until 1.0.0. Pin a version and bump deliberately.