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

@brokenrubik/ui

v2.2.0

Published

BrokenRubik UI: the BR Admin Library (Figma) as shadcn-style React components and Tailwind v4 design tokens.

Readme

@brokenrubik/ui

The BR Admin Library (Figma) as a React component package: shadcn-style components and a Tailwind CSS v4 theme with the exact Figma values. Every BrokenRubik app installs it to get the same look.

  • Every component, with live examples and code: https://brokenrubik.github.io/ui/. The site shows the latest code. It can be ahead of the version on npm, which the site shows at the top.
  • Requirements: React 18 or 19 and Tailwind CSS v4. The package is ESM only, and it works in the Next.js App Router.

Install

pnpm add @brokenrubik/ui      # or: npm install @brokenrubik/ui

The app must already have react, react-dom and tailwindcss 4. The package installs all other libraries and the fonts itself.

Set up (one time for each app)

1. CSS. Put these two lines at the top of the main stylesheet of the app (globals.css, index.css), in this order:

@import "tailwindcss";
@import "@brokenrubik/ui/styles.css";

2. Providers. Add them once, in the app root:

import { Toaster, TooltipProvider } from '@brokenrubik/ui';

<TooltipProvider>
  {children}
  <Toaster theme={isDark ? 'dark' : 'light'} />
</TooltipProvider>

The root TooltipProvider sets shared timing. Pass delayDuration on a single tooltip to override it. Pass the app's current light or dark theme to Toaster explicitly. If the Toaster remounts across sign-ins, Sonner can replay active toasts. In apps with an auth boundary, call the package's toast.dismiss() before switching sessions.

3. Themes. The themes are classes. Set them before the first paint (an inline script in <head>), or the page flashes.

| Class | Where | What it does | | --- | --- | --- | | dark | <html> | The dark theme. The dark: variant follows this class, not the operating system. | | sidebar-light | <html> | The light sidebar ("Sidebar claro"), in the light and the dark theme. | | sidebar-surface | the sidebar element | The components inside the sidebar use the sidebar colors. |

Use

import { Badge, Button, Field, FieldDescription, FieldLabel, Input, toast } from '@brokenrubik/ui';

<Button onClick={() => toast.success('Saved')}>Save changes</Button>
<Button variant="outline" size="sm">Cancel</Button>
<Badge variant="success">Done</Badge>
<Field>
  <FieldLabel htmlFor="name">Project name</FieldLabel>
  <Input id="name" />
  <FieldDescription>Shown on the sidebar and in links.</FieldDescription>
</Field>

The docs site shows every component, its variants and its code.

The names are the same in three places: Figma, shadcn/ui and the code. variant=success in Figma Dev Mode is <Badge variant="success">. The components have the shadcn/ui API (the same parts, asChild, data-slot), so shadcn examples work.

Rules that prevent bugs

  • Import cn from @brokenrubik/ui. A plain shadcn cn removes the Figma text classes (text-body) when you also write a color class.
  • Import toast from @brokenrubik/ui. A toast from another copy of sonner does not reach the package <Toaster />.
  • Add recharts to the app for a Chart, and react-hook-form for a Form. The app imports the chart parts (BarChart, Bar) and useForm from these libraries. Use the same version of recharts as in the dependencies of @brokenrubik/ui: with a different version the app has two copies of Recharts, and the tooltip and the legend do not get the data of the chart.
  • Align versions when the app also imports radix-ui, lucide-react, or react-day-picker. Use compatible dependency ranges. If a pnpm lockfile has duplicate Radix packages, pnpm dedupe can consolidate compatible versions, including those brought in by cmdk and vaul.
  • Use the strong tokens for text. Use text-primary-strong and text-destructive-strong for their respective colors. Use primary and destructive for fills.
  • Preserve focus during a pending action. Use aria-disabled on the Button and guard activation in the click or submit handler. A <Spinner decorative /> beside loading text keeps the spinner out of the button's accessible name.
  • Use CardTitle asChild with a heading to match the page's heading hierarchy.
  • Name a Field when it groups related controls. Pass aria-labelledby referencing the group label, and give each control its own label.
  • Lime (highlight) means "you are here" only. Do not use it for status.

Change the look

Put your changes after the package import. A later declaration wins:

@import "tailwindcss";
@import "@brokenrubik/ui/styles.css";

:root { --radius: 0.375rem; }   /* all corners, from one value */
.dark { --primary: #a78bfa; }

One use: <Button className="h-9 px-4">. The last class wins.

The package includes docs/customize.md alongside its README. It covers the styles, fonts, tokens, variants, and migration from an existing app.

Contribute

CONTRIBUTING.md is the guide: six steps from a change in Figma to a release on npm.

Releases and their notes: GitHub releases.