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 🙏

© 2025 – Pkg Stats / Ryan Hefner

spndrft

v0.0.3

Published

A React library for visual debugging with CSS borders

Readme

🌪️ Spindrift

Heritable borders for React components that just work

pnpm version pnpm downloads license TypeScript

A vaguely more tolerable React debugging experience with granular control


🌟 Why Spindrift?

Tired of wrestling with CSS just to debug your component layouts? Spindrift gives you laser-focused control over visual debugging borders without the performance overhead of recursive cloning.

You get a brand-new Div and Span component with rather underwhelming superpowers but hey, if you're anything like me, CSS is a scourge on the face of the earth and is the only thing stopping you from just doing things.

<Div from>
  <span>✨ Bordered</span>
  <div>✨ Also bordered</div>
  <Div to>
    <span>🚫 No border</span>
  </Div>
</Div>

Note: This is actively being developed. API may change in early versions.

✨ Features

🎯 CSS-only Performance Zero runtime overhead with pure CSS

🔧 Context-based Control
Global enable/disable and theming

📦 Tree-shakeable Import only what you need

🎨 Tailwind Integration Built-in plugin for seamless setup

🔒 TypeScript Native Full type safety with polymorphic components

Production Ready Auto-disable in production builds

📋 Prerequisites

  • ⚛️ React 18+
  • 🎨 Tailwind v4

📦 Installation

# npm
npm install spndrft

# pnpm
pnpm add spndrft

# yarn
yarn add spndrft

🚀 Quick Start

1️⃣ Setup Provider

"use client";

import { SpindriftProvider } from "spndrft";

function App() {
  return (
    <SpindriftProvider enabled={process.env.NODE_ENV !== "production"}>
      <YourApp />
    </SpindriftProvider>
  );
}

2️⃣ Add Styles

/* globals.css */
@import "spndrft/css";

3️⃣ Use Components

import { Div, Span } from "spndrft";

function MyComponent() {
  return (
    <Div from>
      <Span>🎯 This will have borders</Span>
      <Div>🎯 This will also have borders</Div>
      <Div to>
        <Span>⭕ This won't have borders</Span>
        <div>⭕ Neither will this</div>
      </Div>
    </Div>
  );
}

📖 API Reference

SpindriftProvider

The main provider component for global configuration.

interface SpindriftProviderProps {
  enabled?: boolean; // Default: process.env.NODE_ENV !== 'production'
  className?: string; // Default: 'spindrift'
  children: ReactNode;
}

Div & Span

React elements enhanced with Spindrift capabilities.

interface ComponentProps
  extends React.ComponentPropsWithoutRef<"div" | "span"> {
  from?: boolean; // 🟢 Start applying borders from this element
  to?: boolean; // 🔴 Stop applying borders at this element
}

🎯 Usage Patterns

Run the full example locally:

pnpm examples

🌟 Basic Usage

import { Div } from "spndrft";

// Apply borders to this div and all children
<Div from>
  <div>Child 1 📦</div>
  <div>Child 2 📦</div>
</Div>;

🎮 Nested Control

import { Div } from "spndrft";

<Div from>
  <div>✅ Has border</div>
  <Div to>
    <div>❌ No border</div>
    <Div from>
      <div>✅ Has border again</div>
    </Div>
  </Div>
</Div>;

🚀 Production Builds

// ✅ Always enabled
<SpindriftProvider enabled={true}>

// ❌ Always disabled
<SpindriftProvider enabled={false}>

// 🎯 Custom logic
<SpindriftProvider enabled={isDevelopment || isStorybook}>

🔧 TypeScript

Spindrift comes with comprehensive TypeScript support out of the box. Types are well-defined and provide excellent IntelliSense support.

⚡ Performance

| Feature | Benefit | | ------------------------ | ----------------------------------------------------- | | Zero cloning | Uses CSS selectors instead of recursive React cloning | | Constant time | O(1) rendering performance regardless of tree depth | | Tree-shakeable | Only bundles components you actually use | | Production optimized | Can be completely removed from production builds |

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


If Spindrift helps you debug faster, consider giving it a ⭐!

Report BugRequest FeatureDiscussions