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

@bacon-pos/ui

v0.25.2

Published

Bacon POS design system — React Native component library

Readme

@bacon-pos/ui

Bacon POS design system — a scalable React Native component library, built from the Figma design system and published to npm. Works with Expo (SDK 53+) and bare React Native.

  • Zero-config for consumers — ships compiled JS + type definitions. No babel or metro changes required in the app.
  • Token-driven — colors, typography, spacing and radii come straight from Figma. Components read semantic tokens, so light/dark and custom brand themes just work.
  • Versioned with changesets — every added component ships as a new semver release.

Installation (in the app)

npx expo install @bacon-pos/ui react-native-svg
# peer deps react + react-native are already in an Expo app

Requires the New Architecture (default in Expo SDK 53). The Input focus ring uses RN's boxShadow (colored spread), which renders on iOS, Android and web only under the New Architecture. Border colors still work everywhere.

Wrap your app in the ThemeProvider once:

import { ThemeProvider } from '@bacon-pos/ui';

export default function App() {
  return (
    <ThemeProvider mode="light">
      {/* ...your navigation / screens */}
    </ThemeProvider>
  );
}

Use components anywhere below it:

import { Button, Text, Icon } from '@bacon-pos/ui';

<Text variant="h2" weight="semibold">Checkout</Text>
<Button label="Place order" variant="default" onPress={pay} />
<Button
  label="Search"
  variant="secondary"
  leftIcon={<Icon name="search" size={20} />}
/>

// Icon on top — only for shape="square"
<Button
  label="Make a sale"
  shape="square"
  topIcon={<Icon name="plus" size={24} color="#121416" />}
/>

Button and LinkButton accept leftIcon / rightIcon. The square Button additionally accepts topIcon (vertical stack). IconButton is icon-only.

Icons

Icons are themeable SVGs (react-native-svg). Tint with color (a text token or any color string) and size with size:

<Icon name="check" size={24} color="#008C57" />
<Icon name="trash" color="secondary" />

Adding icons — export the SVG from Figma, drop it into assets/icons/<kebab-name>.svg, then run:

pnpm gen:icons

This regenerates src/components/Icon/icons.generated.ts and the IconName union (autocomplete). Each icon is stored as a normalized SVG string and rendered via react-native-svg's SvgXml, so stroke icons, compound fills and circles all render faithfully; colors are rewritten to currentColor so color tints them.

Multicolor brand assets (card logos, flags) live separately as Logo and Flag. They are pre-compiled to real react-native-svg components with SVGR (assets/graphics/ → pnpm gen:graphics), because gradients / clip-paths / masks don't render reliably through runtime SvgXml. Their brand colors are preserved (not tinted).

Fonts (Inter)

The type scale uses Inter. Load it in the app (fonts can't be bundled from a library reliably); if not loaded, RN falls back to the system font.

npx expo install @expo-google-fonts/inter expo-font
import {
  useFonts,
  Inter_400Regular,
  Inter_500Medium,
  Inter_600SemiBold,
} from '@expo-google-fonts/inter';

const [loaded] = useFonts({
  'Inter-Regular': Inter_400Regular,
  'Inter-Medium': Inter_500Medium,
  'Inter-SemiBold': Inter_600SemiBold,
});

Theming

Access the active theme anywhere with useTheme():

import { useTheme } from '@bacon-pos/ui';

const theme = useTheme();
// theme.colors.brand.primary, theme.spacing.lg, theme.radii.md, ...

Custom brand theme:

import { ThemeProvider, lightTheme, type Theme } from '@bacon-pos/ui';

const brand: Theme = {
  ...lightTheme,
  colors: { ...lightTheme.colors, brand: { ...lightTheme.colors.brand, primary: '#123456' } },
};

<ThemeProvider theme={brand}>{children}</ThemeProvider>;

Exposed tokens: palette, typography, fontFamily, fontWeight, spacing, radii, space(n), lightTheme, darkTheme, textStyle(theme, variant, weight).

Typography (global by default, overridable)

The Figma type scale (Inter — Display / H1–H3 / Body / Caption) ships in the theme, so every component uses it automatically. You don't wire anything up.

Override it in one place with overrides (deep-merged onto the base theme, applies to every current and future component):

<ThemeProvider
  overrides={{
    fontFamily: { regular: 'Poppins-Regular', medium: 'Poppins-Medium' },
    typography: { h1: { fontSize: 30, lineHeight: 38 } },
  }}
>
  {children}
</ThemeProvider>

Override for a single instance with the style prop:

<Text variant="h1" style={{ fontSize: 28, letterSpacing: 0.5 }}>Title</Text>

Building a component that renders text without <Text>? Use the helper so it honors global overrides too:

import { useTheme, textStyle } from '@bacon-pos/ui';

const theme = useTheme();
const style = textStyle(theme, 'bodyMedium', 'medium'); // full TextStyle

Local development

pnpm install
pnpm storybook     # component explorer at http://localhost:6006
pnpm test          # unit tests (Jest + RN Testing Library)
pnpm typecheck     # tsc --noEmit
pnpm build         # compile to lib/ via react-native-builder-bob

Adding a component

  1. Create src/components/<Name>/ with <Name>.tsx, <Name>.stories.tsx, <Name>.test.tsx, and index.ts.
  2. Read tokens from useTheme() — never hardcode colors or spacing.
  3. Re-export it from src/components/index.ts.
  4. Add a changeset (see below).

Releasing a new version

  1. Record what changed:
    pnpm changeset
    Choose patch (fixes), minor (new components / props) or major (breaking changes) and write a summary.
  2. Apply the version bump + changelog:
    pnpm version
  3. Publish to npm (requires npm login or an NPM_TOKEN):
    pnpm release

Never commit npm tokens. Use npm login, or set NPM_TOKEN as an environment variable / CI secret. .npmrc is gitignored.


Roadmap

Built from the Figma design system (colors, typography, ~150 icons, inputs, etc.). Current components: Button, IconButton, LinkButton, Input, Card, ProductCard, Surface, Text, Icon (167 icons — 24px outline + fill + 20px optical set), plus multicolor Logo (Visa/Mastercard) and Flag (US/BR) brand assets, QuantityStepper, CodeInput (PIN), CodeField (segmented code), Spinner, Chip + ChipGroup (single/multi select), Avatar (photo or initials), and form controls Checkbox, Radio, Switch (each standalone or with a positionable label). The Figma "loader" is an animated ring, not an icon — use RN's ActivityIndicator (Button/LinkButton already do).