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

@uncinq/component-tokens

v0.1.1

Published

Framework-agnostic CSS design tokens — component layers.

Readme

@uncinq/component-tokens

Component-scoped CSS design tokens for Un Cinq projects — layer 3 of the design token architecture.

What are component tokens?

Component tokens are CSS custom properties scoped to a specific UI component. They sit at the top of the DTCG three-layer model:

primitive   →   semantic   →   component
(raw values)    (purpose)      (component-scoped)

Where primitive and semantic tokens are provided by @uncinq/design-tokens, component tokens map those semantic values to specific parts of a component:

/* semantic token from @uncinq/design-tokens */
--color-brand: var(--color-indigo-600);

/* component token from @uncinq/component-tokens */
--btn-color-bg: var(--color-brand);

A component token answers: "which semantic value does this part of this component use?"


Naming convention

All component tokens follow the pattern: --{component}-{category?}-{property}

--{component}               --btn
  -{category}               --btn-color
    -{property}             --btn-color-bg
      -{state}              --btn-color-bg-hover

Rules

  • Lowercase kebab-case — always
  • Component name first--btn-*, --badge-*, --hero-*
  • color-* for all color values — background, border, text all use color- prefix
  • States at the end-hover, -focus, -active, -disabled
  • Reference semantic tokens — never raw values; always var(--semantic-token)
  • Alphabetical order — tokens within a file are sorted alphabetically; group related tokens with a comment when the component has many properties:
/* Border */
--btn-border-radius: var(--radius-control);
--btn-border-width:  var(--border-width-normal);

/* Color */
--btn-color-bg:   var(--color-brand);
--btn-color-text: var(--color-text-on-brand);

/* Spacing */
--btn-gap:     var(--spacing-sm);
--btn-padding: var(--spacing-control);

Examples

--btn-color-bg:      var(--color-brand);
--btn-color-text:    var(--color-text-on-brand);
--btn-border-radius: var(--radius-control);
--btn-padding:       var(--spacing-control);

--badge-border-radius: var(--radius-sm);
--badge-color-bg:    var(--color-bg-muted);

--hero-color-bg:     var(--color-bg);
--hero-min-height:   50svh;

CSS cascade layers

All tokens are declared inside @layer config, the lowest-priority layer in the stack. This means any project can override any token simply by declaring its own @layer config block after this package:

@import '@uncinq/component-tokens';

/* your project overrides — same layer, wins by source order */
@layer config {
  :root {
    --btn-color-bg: var(--color-secondary);
    --hero-min-height: 80svh;
  }
}

Prerequisites

This package references semantic tokens from @uncinq/design-tokens. Import it before this package:

@import '@uncinq/design-tokens';
@import '@uncinq/component-tokens';

Installation

npm install @uncinq/component-tokens
# or
yarn add @uncinq/component-tokens

Usage — full import

@import '@uncinq/design-tokens';
@import '@uncinq/component-tokens';

Usage — per component

@import '@uncinq/design-tokens';
@import '@uncinq/component-tokens/tokens/component/button.css';
@import '@uncinq/component-tokens/tokens/component/badge.css';

Usage — CDN (no build step)

<link rel="stylesheet" href="https://unpkg.com/@uncinq/design-tokens/tokens/index.css">
<link rel="stylesheet" href="https://unpkg.com/@uncinq/component-tokens/tokens/index.css">

File structure

tokens/
  index.css               ← imports all component token files
  component/
    alert.css             ← alert / notification banner
    badge.css             ← badge / pill / tag
    breadcrumb.css        ← breadcrumb navigation
    button.css            ← button (all variants)
    card.css              ← card (alias → item tokens)
    container.css         ← layout container + grid columns
    details.css           ← <details> / accordion
    dropdown.css          ← dropdown menu
    embed.css             ← video / iframe embed wrapper
    figure.css            ← <figure> + <figcaption>
    heading.css           ← heading typography scale
    hero.css              ← hero / banner section
    item.css              ← item (canonical card-like unit)
    items.css             ← items grid / list wrapper
    link.css              ← inline link
    list.css              ← styled list
    logo.css              ← logotype
    map.css               ← embedded map
    media.css             ← media object (image + text)
    nav.css               ← navigation bar
    offcanvas.css         ← off-canvas panel / drawer
    pagination.css        ← pagination control
    surtitle.css          ← small label above a heading
    table.css             ← data table

References