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

@incld/react

v0.2.1

Published

Shared React provider, appearance, and async primitives for incld components

Readme

@incld/react

Shared React provider, async behavior, accessible primitives, theming, labels, and error helpers for every incld feature package.

Install and configure

npm install @incld/client @incld/react
import {IncldProvider} from '@incld/react';
import '@incld/react/styles.css';

export function Providers({children}: {children: React.ReactNode}) {
  return (
    <IncldProvider
      baseUrl="/api/incld"
      refreshInterval={5_000}
      appearance={{
        colorScheme: 'system',
        accentColor: 'emerald',
        radius: 'large',
        density: 'comfortable',
        variables: {fontFamily: 'Inter, sans-serif'},
      }}
      labels={{loading: 'Please wait', retry: 'Try again'}}
      onError={error => reportError(error.code, error.requestId)}
    >
      {children}
    </IncldProvider>
  );
}

The provider uses IncldBrowser, never a project secret. Mount a framework proxy under /api/incld/v1/*; the browser client appends /v1 to the provider base URL.

IncldProvider props

| Prop | Type | Default / behavior | | --- | --- | --- | | children | ReactNode | Required | | client | IncldBrowser | Optional preconstructed client | | baseUrl | string | /api/incld; ignored when client is supplied | | appearance | IncldAppearance | System scheme, indigo, medium radius, comfortable density | | labels | Record<string, string> | {}; shared localization overrides | | refreshInterval | number \| false | 5000; mounted query hooks refresh while the document is visible. Positive values below 1000 are clamped; false disables automatic refresh. | | onError | (error: IncldError) => void | Called by feature mutation hooks | | className | string | Added to .incld-root | | style | CSSProperties | Merged after mapped theme variables |

The default five-second refresh makes mounted lists, details, histories, progress, and gates converge on server state without application wiring. Refreshes pause while the document is hidden and run immediately when it becomes visible again. Only hooks mounted in the current application view make requests. Use refreshInterval={false} for manual-only behavior or call useIncld().refresh() after an application event.

appearance accepts colorScheme: 'light' | 'dark' | 'system', accentColor: 'indigo' | 'blue' | 'emerald' | 'amber' | 'rose', radius: 'small' | 'medium' | 'large', and density: 'compact' | 'comfortable'.

Theme variable keys are accent, accentHover, accentContrast, accentInk, accentSoft, background, surface, surfaceHover, border, text, muted, danger, dangerSoft, dangerBorder, success, successSoft, successBorder, warning, warningSoft, warningBorder, radius, spacing, shadow, fontFamily, fontSize, lineHeight, and focusRing. They map to --incld-* properties on the provider root.

Hooks

  • useIncld() returns client, resolved appearance, labels, version, resolved refreshInterval, refresh(), and reportError(error). It throws outside a provider.
  • useIncldLabel(key, fallback) returns a provider label or the fallback.
  • useAsyncResource(loader, dependencies) is an abort-aware loader returning {data, error, status, refresh}. Status is idle | loading | success | error.

The provider interval and successful feature mutations call provider refresh(), causing mounted query hooks to refetch. In-flight loaders are aborted when a newer refresh begins.

Async component contract

List/detail components use:

interface AsyncViewProps {
  loading?: ReactNode;
  empty?: ReactNode;
  error?: (error: IncldError, retry: () => void) => ReactNode;
}

Omitted renderers use the accessible defaults below.

Primitives

| Export | Props / behavior | | --- | --- | | IncldButton | Native button props plus busy?; disables and sets aria-busy | | IncldDialog | open, onOpenChange, title, children, description?, className?, backdropClassName?, closeLabel?; focus trap, Escape/backdrop close, focus restoration | | IncldSpinner | label?, className?; role=status | | IncldEmptyState | title, description?, className? | | IncldErrorState | error, retry, className?; role=alert | | IncldFieldError | error?, fields: string | string[], id?, className? | | errorMessagesFor | (error, ...fields) returns deduplicated field messages |

Import each feature package's stylesheet once in addition to the shared stylesheet. Do not nest providers unless you intentionally need a separate browser client and refresh boundary.