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

@renge-ui/svelte

v1.2.0

Published

Svelte stores and components for the Renge design system.

Readme

@renge-ui/svelte

Svelte stores and components for the Renge design system.

Installation

pnpm add @renge-ui/svelte @renge-ui/tokens

Usage

Import the stylesheet

Import the token stylesheet once at your app's entry point. This defines every design token — spacing, type, motion, the palette, and the semantic color variables (--renge-color-bg, --renge-color-fg, --renge-color-accent, …).

// main.ts
import '@renge-ui/tokens/renge.css';

The color system works immediately on import — it ships with the ocean profile as the default (and follows the system light/dark preference). RengeProvider and switchProfile only change which profile is active; you do not need them for var(--renge-color-*) to resolve.

Setup with RengeProvider

Wrap your app with RengeProvider to switch profile/mode at runtime:

<script>
  import RengeProvider from '@renge-ui/svelte/dist/components/RengeProvider.svelte';
</script>

<RengeProvider profile="ocean" mode="light">
  <YourApp />
</RengeProvider>

Using Theme Stores

Access theme state in any component via Svelte stores:

<script>
  import { profile, mode, switchProfile, switchMode } from '@renge-ui/svelte';

  const handleProfileChange = (newProfile) => {
    switchProfile(newProfile);
  };

  const toggleMode = () => {
    switchMode($mode === 'light' ? 'dark' : 'light');
  };
</script>

<div>
  <p>Current profile: {$profile}</p>
  <p>Current mode: {$mode}</p>

  <button on:click={() => handleProfileChange('ocean')}>Ocean</button>
  <button on:click={() => handleProfileChange('earth')}>Earth</button>
  <button on:click={() => handleProfileChange('twilight')}>Twilight</button>

  <button on:click={toggleMode}>
    Toggle {$mode === 'light' ? 'Dark' : 'Light'}
  </button>
</div>

Token References

Use rengeVars to reference design tokens in your components:

<script>
  import { rengeVars } from '@renge-ui/svelte';

  const spacingToken = rengeVars.spacing.md;
  const colorToken = rengeVars.colors.surface;
</script>

<div style="padding: var({spacingToken})">
  Styled with Renge tokens
</div>

Initialize Theme from DOM

If you need to sync the store state with existing DOM attributes at startup:

<script>
  import { initializeTheme } from '@renge-ui/svelte';

  // Call during app initialization
  initializeTheme();
</script>

API

RengeProvider Component

A Svelte component that wraps your app and manages theme initialization.

Props:

  • profile (string, default: "ocean") — The color profile to use ("ocean", "earth", "twilight", "fire", "void", "leaf")
  • mode ("light" | "dark", default: "light") — The color mode

profile Store

A writable store containing the current color profile name.

<script>
  import { profile } from '@renge-ui/svelte';
</script>

<p>{$profile}</p>

mode Store

A writable store containing the current color mode.

<script>
  import { mode } from '@renge-ui/svelte';
</script>

<p>{$mode}</p>

switchProfile(name: string)

Change the color profile and update the document root data-profile attribute.

<script>
  import { switchProfile } from '@renge-ui/svelte';

  switchProfile('earth');
</script>

switchMode(mode: 'light' | 'dark')

Change the color mode and update the document root data-mode attribute.

<script>
  import { switchMode } from '@renge-ui/svelte';

  switchMode('dark');
</script>

initializeTheme()

Read the current theme from DOM attributes and sync the stores. Useful if theme is set via server-side rendering.

<script>
  import { initializeTheme } from '@renge-ui/svelte';

  initializeTheme();
</script>

Theme Switching

When you call switchProfile() or switchMode(), the stores update and the data-profile and data-mode attributes are set on the document root. Your Renge tokens use CSS custom properties scoped by these attributes.

License

MIT