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

@stargazers-stella/cosmic-ui

v0.1.5

Published

Lightweight, themeable React UI primitives built for Tailwind-based apps: Buttons, Cards, Badges, Dialogs, Selects, Dropdown menus, Tables, and more. Styling is driven by design tokens (CSS variables) so you can swap themes without rewriting components.

Readme

Cosmic UI

Lightweight, themeable React UI primitives built for Tailwind-based apps: Buttons, Cards, Badges, Dialogs, Selects, Dropdown menus, Tables, and more. Styling is driven by design tokens (CSS variables) so you can swap themes without rewriting components.

Screenshots

Add your images to docs/screenshots/ and replace these placeholders.

Component gallery Dialog + dropdown Theme tokens (light/dark)

What You Get

  • Accessible primitives powered by Radix UI (Dialog, Select, Dropdown Menu).
  • Variant-based styling with class-variance-authority (consistent variants across components).
  • Tailwind-friendly class merging via clsx + tailwind-merge (exported as cn).
  • Fully typed TypeScript exports + tree-shakeable builds (ESM/CJS + .d.ts).
  • A tiny token layer (theme.css) with light defaults and dark overrides.

Tech Stack

  • React ^18 || ^19 (peer dependencies), TypeScript
  • Bundling: tsup (ESM + CJS + types + sourcemaps)
  • UI primitives: Radix UI (@radix-ui/*)
  • Styling utilities: class-variance-authority, clsx, tailwind-merge
  • Icons/toasts: lucide-react, sonner
  • Publishing: npmjs (https://registry.npmjs.org/)

Install

npm install @stargazers-stella/cosmic-ui

Theme Tokens

Import the token sheet once in your app entry/global styles:

import "@stargazers-stella/cosmic-ui/theme.css";
  • Light defaults live on :root; dark overrides live on .dark.
  • Toggle the dark class on <html> or <body> to switch themes.
  • Helpers included: .surface, .surface-strong, .surface-muted, .surface-inset.
  • --radius controls border radii for cards/controls.

If you already have a token system, override the CSS variables instead of importing theme.css.

Usage

import { Badge, Button, Card, CardContent } from "@stargazers-stella/cosmic-ui";

export function Example() {
  return (
    <Card className="max-w-sm">
      <CardContent className="space-y-3">
        <Badge variant="glow">Signal</Badge>
        <p className="text-sm text-muted-foreground">
          Cosmic UI stays themeable via CSS variables.
        </p>
        <Button>Action</Button>
      </CardContent>
    </Card>
  );
}

The library also exports cn for class merging:

import { cn } from "@stargazers-stella/cosmic-ui";

Component Index

Exported from src/index.ts:

  • Alert, Badge, Button, Card
  • Command (cmdk)
  • Dialog, DropdownMenu, Select
  • Input, Textarea, Table
  • Toaster (sonner) and helpers

Notes (Next.js / RSC)

Most components include "use client" at the top of the module. In Next.js App Router, import and use them from Client Components.

Development

npm install
npm run build

Output goes to dist/ (dist/index.js, dist/index.cjs, dist/index.d.ts).

Running Examples

To view the component showcase:

cd examples/showcase
npm install
npm run dev

This starts a Vite dev server (usually at http://localhost:5173) showing all cosmic-ui components in action.