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

@canonical/react-ds-app

v0.42.0

Published

Application-level UI components for the Pragma design system. This package provides navigation, toolbars, and layout components suited for internal tools and applications.

Readme

@canonical/react-ds-app

Application-level UI components for the Pragma design system. This package provides navigation, toolbars, and layout components suited for internal tools and applications.

Prerequisites

  • React 19 or higher

Installation

bun add @canonical/react-ds-app

The package builds on top of @canonical/react-ds-global.

Usage

import { Button } from "@canonical/react-ds-app";

function AppHeader() {
  return (
    <header>
      <Button>Settings</Button>
    </header>
  );
}

Styling

Every component stylesheet is in ds.components.apps

Every component stylesheet under src is wrapped in one cascade layer:

@layer ds.components.apps {
  .ds.side-navigation {
    /* … */
  }
}

That includes the story-only components under src/storybook, which carry .ds rules of their own and render in the same page as the published ones. .storybook/styles.css is deliberately not wrapped: it is the Storybook harness rather than a component stylesheet, and it is not published.

One consequence is worth knowing before you read a story or a screenshot. The harness re-declares two SideNavigation row-grid custom properties, --sidenav-start and --sidenav-row-columns, because the subcomponent stories (Header, Item, NavTree, …) render inside a bare .ds.side-navigation shell without mounting the root, so the component's own sheet is not in those stories' chunk at all and the row grid would collapse without them — removing them moves 14 of the 26 stories. Where both are on the page, the harness copy is now the authority rather than merely the last one in: it is unlayered and the component's sheet is in ds.components.apps. The values are identical, so nothing computes differently, but the two must be kept in step until the story shell imports the component's sheet, after which the harness copy can go.

The component layers follow the design system's tier tree, flat, one name per tier: ds.components.global for the global packages, then the second level — sites, documentation, stores and apps — which @canonical/styles names in its order statement, and then a sub-tier, which names itself. This package is the shared application tier, so it is ds.components.apps. A product's own package (@canonical/react-ds-app-lxd and its siblings) is a sub-tier: it declares @layer ds.components.apps-lxd; as the first rule of its stylesheet entry and wraps its sheets in that, and because pragma's statement comes first, a name it does not contain is appended after the second level and sorts above it. Deeper wins, which is the tree's own rule — so a product tier overrides this package, this package overrides the global one, and none of it depends on the order a bundler emits them in. Three things follow.

This release lands with, and after, the global tier's own wrap. Taken alone it would invert the two packages: an unlayered author rule outranks every layered one, so wrapping this package while @canonical/react-ds-global is still unlayered hands the global tier every rule the two contend. Measured over this package's 26 Storybook stories, that is 80 of 810 elements — 74 icons in the side navigation lose vertical-align: sub to the global Icon's middle, and the application shell gains a third grid track from the global package's work-in-progress grid ApplicationLayout, which styles .application-layout, the same class this package's ApplicationLayout renders. With both packages layered, nothing moves at all: 0 of 810 elements, in every condition measured.

Once both are layered, no selector this package declares is also declared by @canonical/react-ds-global, so nothing changes hands. What the layer buys is the answer to the next collision, and that answer is fixed rather than emitted: today specificity settles the .application-layout near-miss, one seat apart; a global rule written at the same seat as this package's would have been settled by whichever bundle a loader emitted last, and is now settled by layer, in this package's favour, whatever the emit order and without a longer selector or an !important.

The guarantee needs @canonical/styles on the page, and needs its statement first. An order statement is what fixes the relative order of two sublayers; without it they fall back to the order they first appear in, and a bundle that emits this package before @canonical/react-ds-global hands the win back to the global tier. One nuance, measured: ds.components.apps is not a name the statement contains yet — it still names the retired ds.components.app, and gains the second level in full with the rework of the styles package — but a sublayer the statement does not name is appended after every name it fixed, so with the statement on the page this package already beats @canonical/react-ds-global in both emit orders. Nothing under src/lib imports @canonical/styles — an application imports it once, as the installation instructions above say.

An application's own unlayered CSS now beats every rule in this package, whatever the selectors on either side, because an unlayered author rule outranks every layered one. That is CSS working as designed, and it is the deliberate escape hatch: an application that needs to override a component writes a plain rule and it wins. An application that does not want to win by accident puts its CSS in @layer app.

Rule for contributors: every component stylesheet under src opens with that wrapper. @keyframes and a component's own :root token defaults go inside it; @property and @font-face registrations stay outside, above the block, because no layer sorts a registration. Never reach for !important to win a fight — an important declaration inverts the layer order, so it cannot be arbitrated by layers at all. The "Cascade Layers" section of the @canonical/styles README is the reference for the full order and for what is deliberately left unlayered.

Storybook

cd packages/react/ds-app
bun run storybook

Component Specifications

Component specifications are defined in the Design System Ontology.