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/petals

v1.2.0

Published

Semantic composition patterns for Renge — pre-made combinations of tokens for typography, spacing, cards, and UI patterns.

Readme

@renge-ui/petals

Semantic composition patterns for Renge — pre-made combinations of tokens for typography, spacing, cards, and UI patterns.

A petal is a named group of Renge token values that form a cohesive pattern. Instead of manually composing tokens, petals apply proven combinations that maintain design consistency.

Why Petals?

Renge tokens are orthogonal — each scale (spacing, color, typography) stands alone. This is powerful for fine-grained control, but it means consumers often compose the same token combinations repeatedly.

Petals bridge that gap:

// Without petals — manual composition
const styles = {
  fontSize: 'var(--renge-font-size-lg)',
  lineHeight: 'var(--renge-line-height-lg)',
};

// With petals — semantic pattern
const styles = petals.typography.bodyLarge.tokens;

Installation

npm install @renge-ui/petals @renge-ui/tokens

Petals depend on @renge-ui/tokens for CSS custom property definitions.

Usage

Apply a typography petal

import { petals } from '@renge-ui/petals';

const heading = petals.typography.displayLarge;
console.log(heading.tokens);
// {
//   fontSize: 'var(--renge-font-size-4xl)',
//   lineHeight: 'var(--renge-line-height-4xl)',
// }

Use petals in CSS-in-JS

import { petals } from '@renge-ui/petals';

const styles = {
  ...petals.typography.headingMedium.tokens,
  ...petals.spacing.comfortable.tokens,
  color: 'var(--renge-color-fg)',
};

Use petals in Tailwind

// tailwind.config.js
import { petals } from '@renge-ui/petals';

// Reference petals in Tailwind utilities
export default {
  theme: {
    extend: {
      spacing: {
        petal_comfortable: petals.spacing.comfortable.tokens.padding,
      },
    },
  },
};

Petal Categories

Typography

Eight levels of text styling, each combining font size with line-height:

  • displayLarge — Hero headline (4xl)
  • displayMedium — Page title (3xl)
  • headingLarge — Section heading (2xl)
  • headingMedium — Subsection (xl)
  • bodyLarge — Emphasis text (lg)
  • bodyRegular — Default prose (base)
  • bodySm — Secondary text (sm)
  • labelXs — UI labels (xs)

Spacing

Four levels of internal spacing following the Fibonacci scale:

  • generous — Maximum breathing room (space-5 + gap-4)
  • comfortable — Natural spacing (space-4 + gap-3)
  • compact — Tight spacing (space-3 + gap-2)
  • condensed — Minimal spacing (space-2 + gap-1)

Cards

Four surface levels with padding, radius, and shadow hierarchy:

  • surfaceGenerous — Full-featured (space-5, radius-5, shadow-layer-2)
  • surfaceComfortable — Standard (space-4, radius-4, shadow-layer-1)
  • surfaceCompact — Tight (space-3, radius-3, shadow-layer-1)
  • surfaceMinimal — Subtle (space-2, radius-2, no shadow)

Interactive

Button and focus patterns with padding, radius, and transitions:

  • buttonLarge — Primary action
  • buttonMedium — Standard button
  • buttonSmall — Compact button
  • focus — Focus state indicator

Compositions

Higher-level patterns for complete component styling:

  • textField — Input field (padding, radius, border, transition)
  • badge — Compact label (tight padding, full radius, xs text)
  • chip — Dismissible tag (small padding, full radius, sm text)

Accessing Petals

Direct import

import { petals } from '@renge-ui/petals';

petals.typography.displayLarge.tokens;
petals.spacing.comfortable.tokens;
petals.cards.surfaceComfortable.tokens;

Category imports

import { typography, spacing, cards, interactive, compositions } from '@renge-ui/petals';

typography.bodyRegular.tokens;
spacing.compact.tokens;

Full petal structure

Each petal has:

{
  label: string;           // Display name
  description: string;     // Use case explanation
  tokens: CSSProperties;   // CSS custom property references
}

TypeScript

Petals are fully typed:

import type { AllPetals, PetalCategory } from '@renge-ui/petals';

// Type-safe petal access
const category: PetalCategory = 'typography';
const petal: AllPetals['typography'] = petals.typography;

Philosophy

Petals are not components. They:

  • ✅ Compose tokens into semantic patterns
  • ✅ Stay framework-agnostic (CSS custom properties)
  • ✅ Enable consistent token combinations
  • ✅ Document common patterns

They do not:

  • ❌ Include component logic or markup
  • ❌ Prescribe HTML structure
  • ❌ Create new colors or spacing values
  • ❌ Replace design tokens

Use petals with @renge-ui/react, @renge-ui/svelte, @renge-ui/vue, or any other framework — they're just CSS custom properties.

License

MIT — see LICENSE in the repository.