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

@everything-dies/flesh-cage

v0.2.1

Published

Modern CSS-in-TypeScript with Shadow DOM & Constructable Stylesheets

Readme

@everything-dies/flesh-cage

Modern CSS-in-TypeScript with Shadow DOM & Constructable Stylesheets

CI License: MIT

What is Flesh Cage?

Flesh Cage is a paradigm shift in component styling that combines four powerful concepts:

  1. 🎨 Skins (Not Themes) - Complete visual languages, not variable swaps (CSS Zen Garden at scale)
  2. 🌐 Attribute-Driven Styling - Semantic attributes (ARIA, data-*) for styling, not prop interpolation
  3. 📝 CSS-in-TypeScript - Full ecosystem access at build-time, zero runtime cost
  4. ⚡ Constructable Stylesheets + Shadow DOM - True encapsulation and efficient style management

Quick Start

npm install @everything-dies/flesh-cage
# or
yarn add @everything-dies/flesh-cage
import { styled, Provider } from '@everything-dies/flesh-cage'

// Define base component
const ButtonBase = ({ children }) => (
  <button part="surface">
    <span part="label">{children}</span>
  </button>
)

// Create shadow component with multiple skins
export const Button = styled(ButtonBase, {
  name: 'styled-button',
  skins: {
    material: () => import('./skins/material'),
    brutalist: () => import('./skins/brutalist'),
  },
  exportparts: 'label, surface',
})

// Use with Provider (no prop drilling!)
function App() {
  return (
    <Provider skin="material">
      <Button>Click Me</Button>
    </Provider>
  )
}

API

Main Export

import { styled, Provider, useContext } from '@everything-dies/flesh-cage'
import type {
  SkinLoader,
  Skins,
  StyledConfig,
} from '@everything-dies/flesh-cage'

Component API:

  • styled(Component, config) - Create shadow components with skins
  • Provider - Context-based skin management
  • useContext() - Access current skin from context

Type Definitions:

  • SkinLoader - Function type for lazy-loading skin CSS
  • Skins<T> - Record mapping skin names to loaders
  • StyledConfig<Names> - Configuration object for styled()
  • ProviderProps - Props for Provider component

Features

✨ Provider Pattern (No Prop Drilling!)

<Provider skin="material">
  <Button>Uses material</Button>

  {/* Nested providers override */}
  <Provider skin="dark">
    <Button>Uses dark</Button>
  </Provider>
</Provider>

🎨 Core API

styled(Component, config) - Create shadow components

const ButtonBase = ({ children }) => <button>{children}</button>

export const Button = styled(ButtonBase, {
  name: 'styled-button',
  skins: { material: () => import('./material') },
  exportparts: 'label, surface',
  suspendable: false, // Optional: integrate with React Suspense
})

Configuration Options:

  • name - Custom element tag name (required, must contain hyphen)
  • skins - Map of skin names to lazy loader functions
  • suspendable - Enable React Suspense integration (default: false)
  • Any HTML attributes (e.g., exportparts, class, data-*)

Suspendable Components:

When suspendable: true, the component integrates with React Suspense:

export const Button = styled(ButtonBase, {
  name: 'styled-button',
  skins: { material: () => import('./material') },
  suspendable: true,
})

// Use with Suspense boundary
<Suspense fallback={<div>Loading skin...</div>}>
  <Button>Click Me</Button>
</Suspense>

Automatic Abort on Skin Switch:

Flesh Cage automatically aborts stale skin loads when switching skins rapidly. Uses AbortController internally to prevent race conditions where a slow-loading skin overwrites a fast-loading one.

Provider - Context-based skin management

<Provider skin="material">
  <Button>Uses material skin</Button>
</Provider>

useContext() - Access current skin

import { useContext } from '@everything-dies/flesh-cage'

function MyComponent() {
  const skin = useContext()
  return <div>Current skin: {skin}</div>
}

📊 Performance

  • Lazy loading - Dynamic imports for code-splitting
  • Fast theme switching - Direct stylesheet replacement via adoptedStyleSheets
  • Small bundle - Minimal runtime overhead, tree-shakeable

Documentation

Essential

Design Philosophy

Future Features

  • Proposals - Planned features (not yet implemented)

Contributing

See CONTRIBUTING.md for development guidelines.

License

MIT © Fernando Camargo


Built with cutting-edge web platform primitives:

  • Shadow DOM for true encapsulation
  • Constructable Stylesheets for performance
  • Web Components for interoperability
  • TypeScript for type safety
  • React for developer experience