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

@basenative/platform

v2.1.0

Published

Apple iOS, iPadOS, and macOS 27 kit tokens and semantic controls for BaseNative — colour, type, materials, and data-bn controls that do not restyle @basenative/components

Readme

@basenative/platform

Apple iOS, iPadOS, and macOS 27 kit tokens, plus a semantic-HTML control for every control in both kits. Colour, type, Liquid Glass parameters, device dimensions, macOS control sizes, and macOS materials are the values extracted from the kits. Increased contrast is derived, because the kits only define Light and Dark, and every derived colour is labeled as such.

This package does not restyle @basenative/components. Those controls keep data-bn="button" and the BaseNative visual language. Kit controls use data-bn="bn-*". @basenative/ios is unchanged: its accents stay the classic UIColor table the express site already consumes. Rolling this language out to GreenPut is a separate change.

Zero production dependencies. The font stack names SF Pro and falls through to the system UI font. SF Pro files, SF Symbols, and Apple artwork are not shipped.

@basenative/platform              kit, renderers, detectPlatform, catalogPage
@basenative/platform/tokens       kit, PROVENANCE, colorSlug, derivePalette
@basenative/platform/css          tokensCss(spec)
@basenative/platform/platform     detectPlatform, applyPlatform, initPlatform
@basenative/platform/components   renderBn*
@basenative/platform/catalog      catalogPage()
@basenative/platform/tokens.css
@basenative/platform/components.css

Adoption

  1. Link the stylesheets. Tokens win by attribute, not by rewriting existing components.
<link rel="stylesheet" href="/node_modules/@basenative/platform/tokens.css" />
<link rel="stylesheet" href="/node_modules/@basenative/platform/components.css" />
  1. Choose a platform on an ancestor. Default, with no attribute, is iOS, light, Dynamic Type Large, iPhone, with medium macOS control-size tokens also defined so the names exist.
<body data-bn-platform="ios" data-theme="light"></body>
<body data-bn-platform="macos" data-bn-control="medium" data-theme="dark"></body>

Class mirrors: bn-platform-ios, bn-platform-macos, bn-device-iphone, bn-device-ipad, bn-type-xxxlarge, bn-contrast-more.

  1. Or let the user agent choose, without overwriting an attribute you already set:
import { initPlatform } from '@basenative/platform';

initPlatform(document.documentElement);

detectPlatform maps iPhone and iPod to iOS phone, iPad (and a touch Mac) to iOS tablet, other Macs to macOS at the medium control size, and anything else with a coarse pointer to iOS phone.

  1. Render a control. The host is a real element. There is no class and no style attribute.
import { renderBnButton, renderBnAlert } from '@basenative/platform';

renderBnButton('Save', { variant: 'prominent', size: 'large' });
renderBnAlert({
  title: 'Delete this item?',
  message: 'This cannot be undone.',
  actions: [
    { label: 'Cancel', role: 'none' },
    { label: 'Delete', role: 'destructive' },
  ],
});
  1. Vary the kit axes when you need them.

| Attribute | Values | | ------------------ | ---------------------------------------------------------------------------------------------------------- | | data-bn-platform | ios, macos | | data-theme | light, dark (also prefers-color-scheme) | | data-bn-contrast | more, default (also prefers-contrast: more) | | data-bn-type | xsmall, small, medium, large, xlarge, xxlarge, xxxlarge, ax1–ax5 | | data-bn-leading | loose, tight | | data-bn-device | iphone, ipad, duo-inner-landscape, duo-inner-portrait, duo-outer-landscape, duo-outer-portrait | | data-bn-control | mini, small, medium, large, xl |

Increased contrast rewrites the same --bn-plat-* colour names. It is not a third kit mode. data-bn-contrast="default" opts out of prefers-contrast.

  1. Browse the catalog:
node packages/platform/catalog/server.js

That serves every control, both platforms, light and dark, increased contrast, an xxxLarge type stage, and the macOS Large control size, on port 4317.

Token names are --bn-plat-* (--bn-plat-color-accents-blue, --bn-plat-font-body-size, --bn-plat-glass-frost-regular). Regenerate the sheet with node generate.js inside this package after editing data/tokens.json. Do not hand-edit src/tokens.css or src/kit.js.

What the screenshots could not settle

VERIFY lists these. The shapes the page screenshots did confirm are implemented and are not in the list.

  • Fit-to-page shots of dense pages (Keyboards, Sidebars, Toolbars, Lists and Tables, Windows, Menu Bar and Dock) are not reliable pixel measurements. Those controls use tokens.json and the HIG.
  • macOS pressed fills are a brightness filter. Clicked and disabled fills were not readable.
  • The macOS selected segment uses Accents/Blue. The fit does not show whether the kit uses blue or a darker gray.
  • The iOS switch is 51×31 from the HIG. The shot confirms the pill, gray off, green on, and a white knob.
  • Material blur radii were not readable. macOS materials carry fill, opacity, and blend only. Liquid Glass frost mapped to backdrop-filter blur is a labeled mapping, not the kit GLASS effect.
  • macOS Title 2 Emphasized is Inter Bold in the kit file. Weight 700 is emitted; the family is likely a Figma fallback.
  • corner-shape: squircle does not reproduce Figma smoothing 0.6.
  • Neither kit defines motion. No spring curves were added.
  • Increased contrast is derived.
  • SF Symbols and app artwork are not shipped. Icon slots are a glyph or a monogram.

License

Apache-2.0.