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

@codefast/ui

v0.10.0

Published

Core UI components library built with React and Tailwind CSS

Readme

@codefast/ui

70+ accessible React components built on Radix UI primitives and styled with Tailwind CSS 4, for teams that want a typed, themeable component library they can import one piece at a time.

npm version license

Overview

@codefast/ui is a library of accessible React components you import one at a time. Each component is built on a Radix UI primitive, styled with Tailwind CSS 4, and typed down to its props. You theme the whole set in plain CSS, and switch light and dark without JavaScript.

You bring the Tailwind pipeline; the package ships the components and their stylesheets as source.

  • Accessible by construction. Keyboard navigation, focus management, and ARIA semantics come from Radix UI primitives.
  • Fully typed. Every component exports its prop types — ButtonProps, DialogContentProps, and so on — for wrappers and composition.
  • Tree-shakeable ESM. Each component is its own subpath export, so your bundler includes only what you import.
  • Themeable in plain CSS. Palettes of oklch design tokens with a .dark variant, switchable without JavaScript.
  • Hooks, variants, and utilities included. The building blocks behind the components are exported too.

Installation

pnpm add @codefast/ui

Or the equivalent with your package manager: npm install @codefast/ui, yarn add @codefast/ui, or bun add @codefast/ui.

@codefast/ui requires:

  • Node.js 24 or later.
  • TypeScript 7 or later for its types.
  • Chrome and Edge 136, Firefox 136, or Safari 18.4 or later in the browser (support policy).
  • React 19 — react and react-dom (19 or later) are peer dependencies; @types/react and @types/react-dom are optional peers.
  • Tailwind CSS 4 at build time — the stylesheets are Tailwind source, and rely on your Tailwind pipeline to compile them.

The package is published on 0.x and versioned on its own track: breaking changes ship as minor versions, so pin the minor version when you need stability.

Quick start

Import Tailwind, a palette, and the preset — in that order — in your global stylesheet:

@import "tailwindcss";
@import "@codefast/ui/css/themes/neutral.css";
@import "@codefast/ui/css/preset.css";

Then use any component:

import { Button } from "@codefast/ui/button";

export function MyPage() {
  return <Button variant="outline">Click me</Button>;
}

@codefast/ui/css/style.css bundles those three imports into one entry. Use it when the neutral palette is the one you want:

@import "@codefast/ui/css/style.css";

Per-component imports

Every component ships as its own subpath export, named after the component, so your bundle carries only what you use:

import { Button } from "@codefast/ui/button";
import { Dialog, DialogContent, DialogTitle, DialogTrigger } from "@codefast/ui/dialog";

Prop types travel with their component:

import type { ButtonProps } from "@codefast/ui/button";

export function SubmitButton(props: ButtonProps) {
  return <Button type="submit" {...props} />;
}

All components, prop types, hooks, and variants are also re-exported from the root entry, @codefast/ui.

Beyond the components, the package exposes:

  • @codefast/ui/hooks/* — standalone hooks such as useMediaQuery (@codefast/ui/hooks/use-media-query), useIsMobile, useCopyToClipboard, useMutationObserver, and usePagination.
  • @codefast/ui/variants/* — the variant functions behind the styled components, such as buttonVariants from @codefast/ui/variants/button, for styling an element that isn't the component itself.
  • @codefast/ui/primitives/* — unstyled building blocks the styled components are composed from.
  • @codefast/ui/lib/utils — cn() for merging class names and tv() for declaring variants, plus the VariantProps type.

For example, to style a link like a button:

import { buttonVariants } from "@codefast/ui/variants/button";
import { cn } from "@codefast/ui/lib/utils";

export function DocsLink() {
  return (
    <a className={cn(buttonVariants({ variant: "outline", size: "sm" }), "no-underline")} href="/docs">
      Read the docs
    </a>
  );
}

Theming

Theme tokens live in plain CSS files. Swap themes/neutral.css in the imports above for any palette under @codefast/ui/css/themes/:

amber · blue · cyan · emerald · fuchsia · gray · green · indigo · lime · neutral · orange
pink · purple · red · rose · sky · slate · stone · teal · violet · yellow · zinc

Each palette defines light tokens on :root and dark tokens under .dark. Toggle the dark color scheme by adding the dark class to <html>, or any ancestor:

document.documentElement.classList.toggle("dark", isDark);

To customize, override CSS custom properties after the imports. Palette tokens such as --primary come from the theme file; shape tokens such as --radius come from the preset — so declare your overrides after both:

@import "tailwindcss";
@import "@codefast/ui/css/themes/neutral.css";
@import "@codefast/ui/css/preset.css";

:root {
  --radius: 0.5rem;
  --primary: oklch(0.4 0.2 260);
}

.dark {
  --primary: oklch(0.72 0.18 260);
}

Documentation

Contributing

The package is developed in the codefast monorepo; the repo-wide contributing guide covers setup, the test taxonomy, and the release flow.

License

Released under the MIT License.