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

@snowball-ui/react-web

v0.1.2

Published

React web runtime components and provider for Snowball UI.

Readme

@snowball-ui/react-web

React components and web runtime helpers for Snowball UI.

Use this package from React web applications. Component contracts live in @snowball-ui/foundation, theme definitions live in @snowball-ui/themes and @snowball-ui/tokens, and documentation/tooling metadata lives in @snowball-ui/registry.

Install

pnpm add @snowball-ui/react-web react react-dom

react and react-dom are peer dependencies. This package currently declares React 19 peer ranges.

Styling Setup

SnowballThemeProvider supplies Snowball CSS variables, but the runtime also uses Tailwind utility class names. Make sure your app's Tailwind CSS build scans the Snowball runtime package.

For Tailwind CSS v4, use the same pattern as the local Storybook setup and adjust the paths for your app:

@import "tailwindcss" source(none);
@source "./src";
@source "../node_modules/@snowball-ui/react-web/dist";

In this workspace, Storybook scans packages/react-web/src directly while developing unpublished source.

Provider Setup

Wrap the part of the app that renders Snowball components with SnowballThemeProvider.

import { SnowballThemeProvider } from '@snowball-ui/react-web';

export function Root() {
  return (
    <SnowballThemeProvider>
      <App />
    </SnowballThemeProvider>
  );
}

The theme prop is optional and defaults to default. Use the exported ThemeName type when storing a documented theme name in app state.

The provider renders a scoped wrapper with Snowball CSS variables and data attributes. Overlay components use the provider scope as their default portal container, so keep overlays under the provider.

Importing Components

Import public APIs from the package root:

import {
  Button,
  TextField,
  Toast,
  type ThemeName,
} from '@snowball-ui/react-web';

Public component exports:

Agreement, AgreementV3, AgreementV4, AlertDialog, Asset, Badge, BarChart,
BoardRow, Border, BottomCTA, FixedBottomCTA, BottomInfo, BottomSheet, Bubble,
Button, Card, Checkbox, ConfirmDialog, Dialog, GridList, Highlight, IconButton,
Keypad, AlphabetKeypad, NumberKeypad, FullSecureKeypad, ListFooter, ListHeader,
ListRow, ListRowLegacy, Loader, Menu, Modal, NumericSpinner, Paragraph, Post,
ProgressBar, ProgressStepper, Rating, Result, SearchField, SegmentedControl,
Skeleton, Slider, SplitTextField, Stepper, StepperRow, Switch, TableRow, Tab,
Tabs, TextArea, TextButton, TextField, Toast, Tooltip, Top

Public provider, hook, and utility exports:

SnowballThemeProvider, ThemeName, cx, useBottomSheet, useDialog, useToast,
webSemanticStyleTokens, webPrimitiveStyleTokens, webEffectStyleTokens

Some exports are compound components with static members, such as Asset, BottomSheet, Dialog, Post, StepperRow, Toast, and Top. See the generated TypeScript types or the Storybook stories for their member APIs.

Basic Usage

import {
  Button,
  SnowballThemeProvider,
  TextField,
} from '@snowball-ui/react-web';

export function App() {
  return (
    <SnowballThemeProvider>
      <form>
        <TextField
          label="Email"
          name="email"
          placeholder="[email protected]"
          type="email"
        />
        <Button type="submit" variant="fill" color="primary">
          Continue
        </Button>
      </form>
    </SnowballThemeProvider>
  );
}

Theming

SnowballThemeProvider converts the selected theme from @snowball-ui/themes into CSS variables such as --sb-bg-surface-default, --sb-fg-text-primary, and --sb-action-primary-bg.

Web style token helpers are exported from the public package entrypoint for custom web surfaces that need to align with component internals:

import {
  webEffectStyleTokens,
  webPrimitiveStyleTokens,
  webSemanticStyleTokens,
} from '@snowball-ui/react-web';

Use webSemanticStyleTokens for theme-aware color roles. These values are CSS variable references, so they follow the nearest SnowballThemeProvider scope. Use webPrimitiveStyleTokens only when a fixed primitive value is required to match a legacy visual detail or non-role color. Use webEffectStyleTokens for non-semantic effects such as glass surfaces, focus glows, masks, backdrops, and component shadow recipes.

Use the exported ThemeName type when storing theme state:

import {
  SnowballThemeProvider,
  type ThemeName,
} from '@snowball-ui/react-web';

const theme: ThemeName = 'dark';

export function AppShell() {
  return <SnowballThemeProvider theme={theme}>...</SnowballThemeProvider>;
}

Overlays and Hooks

The overlay components can be controlled directly with React state. The package also exports small state hooks that prepare props for the matching components. The hooks do not render anything by themselves; render the overlay component and spread the returned props.

import {
  AlertDialog,
  BottomSheet,
  Button,
  ConfirmDialog,
  Toast,
  useBottomSheet,
  useDialog,
  useToast,
} from '@snowball-ui/react-web';

export function Actions() {
  const dialog = useDialog();
  const toast = useToast();
  const sheet = useBottomSheet();

  return (
    <>
      <Button
        onClick={() =>
          dialog.openConfirm({
            title: 'Delete item?',
            description: 'This action cannot be undone.',
            cancelLabel: 'Cancel',
            confirmLabel: 'Delete',
          })
        }
      >
        Open dialog
      </Button>

      <Button onClick={() => toast.openToast('Saved')}>Show toast</Button>

      <Button
        onClick={() =>
          sheet.open({
            header: <BottomSheet.Header>Options</BottomSheet.Header>,
            children: <div>Sheet content</div>,
          })
        }
      >
        Open sheet
      </Button>

      <AlertDialog {...dialog.alertDialogProps} />
      <ConfirmDialog {...dialog.confirmDialogProps} />
      <Toast {...toast.toastProps} />
      <BottomSheet {...sheet.bottomSheetProps} />
    </>
  );
}

Related overlay exports include AlertDialog, BottomSheet, ConfirmDialog, Dialog, Menu, Modal, Toast, and Tooltip.

Storybook and Local Development

This repository uses pnpm workspaces.

pnpm install
pnpm storybook

pnpm storybook runs the web Storybook app on port 6006 through apps/storybook-web. Stories live in apps/storybook-web/src/stories and should render examples under SnowballThemeProvider.

Build Storybook before merging docs-facing or visual changes:

pnpm build-storybook

Testing and Build

Useful commands from the repository root:

pnpm --filter @snowball-ui/react-web typecheck
pnpm --filter @snowball-ui/react-web build
pnpm test
pnpm typecheck
pnpm build

pnpm test runs the Vitest suite, including tests under packages/react-web/src. There is no package-local test script in @snowball-ui/react-web.

For visual parity checks, use the repository's internal audit runner. Generated audit artifacts should not be committed.

Maintainer Notes

Keep the contract, runtime, metadata, and examples aligned when changing a component:

  • packages/foundation is the semantic component contract.
  • packages/react-web is the React web runtime implementation and public export surface.
  • packages/registry is the normalized documentation and automation metadata.
  • apps/storybook-web is the rendering and review hub.

For a component change, update the foundation contract, react-web component and tests, registry component metadata, and Storybook story together. Add or adjust the export in packages/react-web/src/index.ts when the public API changes. Stop and resolve any foundation/registry disagreement before continuing.

Before merging visual or docs-facing work, run focused component tests plus pnpm --filter @snowball-ui/storybook-web build-storybook.

License

MIT