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

polaris-shadcn

v0.1.1

Published

shadcn/ui components styled with Shopify Polaris design tokens. Use the CLI to add components to your Vite + React project.

Readme

polaris-shadcn

shadcn/ui components styled with Shopify Polaris design tokens. Use the CLI to add components to your Vite + React project.

Getting started

polaris-shadcn requires Tailwind CSS v4 and a path alias (@/*).

1. Install Tailwind CSS v4

Skip this step if you already have Tailwind v4 set up.

npm install tailwindcss @tailwindcss/vite

Add the plugin to vite.config.ts:

import tailwindcss from "@tailwindcss/vite";

export default defineConfig({
  plugins: [tailwindcss()],
});

If you don't already have a CSS entrypoint, create app/app.css (or src/app.css) with the Tailwind v4 entrypoint import (@import "tailwindcss";), then import it in your root component (app/root.tsx for React Router apps):

// app/root.tsx
import "./app.css";
/* app/app.css */
@import "tailwindcss";

See the Tailwind CSS Vite guide for full details.

2. Configure path alias

The CLI requires an @/* import alias. Add to tsconfig.json:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./app/*"]
    }
  }
}

And to vite.config.ts:

import path from "path";

export default defineConfig({
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./app"),
    },
  },
});

Adjust ./app to ./src if your project uses a src/ directory.

3. Initialize polaris-shadcn

npx polaris-shadcn@latest init

This runs shadcn init using your project’s package manager (detected from packageManager in package.json or from your lockfile) and creates the theme file at app/styles/polaris-shadcn.css (or src/polaris-shadcn.css). It also strips shadcn’s color remapping in your Tailwind entry so bg-background uses the polaris-shadcn tokens. On fresh installs, it removes the shadcn/tailwind.css import and the default shadcn :root/.dark token blocks to avoid white backgrounds.

If your project doesn’t have a lockfile yet, pass --pm:

npx polaris-shadcn@latest init --pm pnpm

4. Import the theme

Add the import to your CSS entry point (app/app.css), after the Tailwind import:

@import "tailwindcss";
@import "./styles/polaris-shadcn.css";

5. Add components

npx polaris-shadcn@latest add button card tabs

Components are added to app/components/ui (or src/components/ui).

CLI options

# overwrite existing component files
npx polaris-shadcn@latest add button --force

# explicitly select the package manager for installs / fallback
npx polaris-shadcn@latest add button --pm pnpm

# custom components directory (should point to components/ui)
npx polaris-shadcn@latest add button --path app/components/ui

# custom theme file path
npx polaris-shadcn@latest add button --css app/styles/polaris-shadcn.css

# skip dependency installation
npx polaris-shadcn@latest add button --no-install

Fallback behavior

If a component isn’t in this repo’s registry, the CLI automatically falls back to:

pnpm dlx shadcn@latest add <component>
# yarn dlx shadcn@latest add <component>
# bunx shadcn@latest add <component>
# npx shadcn@latest add <component>

The fallback uses whatever shadcn configuration is present in your app and may prompt if components.json isn’t configured. Run npx polaris-shadcn@latest init (or npx shadcn@latest init) to set up that config first.

Demo app (this repo)

npm install
npm run dev

Vite will start the dev server (defaults to http://localhost:5173).

Screenshots

npm run screenshots

Runs the Playwright screenshot pipeline and writes images to ./screenshots/.

How it works

  • src/components/ui/* contains the shadcn-style wrapper components used by the demo app.
  • Polaris web components are loaded via the script tag in index.html.
  • The demo theme layer lives in src/index.css.
  • The CLI registry templates live in registry/templates and are copied into consuming apps.
  • Demo routes are registered in src/demos/registry.jsx and rendered by src/pages/DemoPage.jsx.

Adding a new demo

  1. Create or update a wrapper in src/components/ui/.
  2. Add a new entry to demoRegistry in src/demos/registry.jsx with both the wrapper and Polaris-only demos.