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

@impulse-ui-native/core

v17.4.2

Published

Core hooks and utilities for the ImpulseUI Native component library.

Readme

@impulse-ui-native/core

Framework-level hooks and small utilities shared across Impulse UI Native.

Installation

pnpm add @impulse-ui-native/core

Main exports

  • useControllableState supports controlled and uncontrolled component state.
  • useEventCallback returns a stable callback that uses the latest handler.
  • useTimer runs the latest callback once after a duration, with cancellation and optional native background pausing.
  • useBackHandler subscribes to Android hardware Back with the latest callback and automatic cleanup.
  • useIsOpen manages common open/close state.
  • useWhyDidYouUpdate helps inspect prop changes during development.
  • merge recursively applies a DeepPartial value to a target object.
  • uuid creates unique identifiers.
  • resolverStateSetter resolves React value-or-updater state arguments.
  • DeepPartial is the recursive partial type used by theme overrides.

Example

import { useControllableState } from "@impulse-ui-native/core";

function Disclosure({ open, onOpenChange }) {
  const [isOpen, setIsOpen] = useControllableState({
    prop: open,
    defaultProp: false,
    onChange: onOpenChange,
  });

  // Render using isOpen and setIsOpen.
}

This is a low-level package. Install @impulse-ui-native/toolkit when you want the complete UI system from one entry point.

Hardware Back

useBackHandler(() => {
  dismiss();

  return true;
}, open);

Return true to consume the press or false to let other handlers and the native default continue. The optional enabled argument defaults to true. Disabling or unmounting removes the listener; callback changes use the latest handler without resubscribing.

Timer

useTimer({
  duration: 3000,
  callback: dismiss,
  enabled: open,
  pauseOnBackground: true,
});

enabled defaults to true and pauseOnBackground defaults to false. Non-positive or non-finite durations disable the timer. Changing the callback preserves the countdown and executes the latest handler. Disabling or unmounting cancels it; re-enabling or changing the duration/background policy starts a fresh countdown. With background pausing enabled, time spent inactive does not count toward the duration. A completed timer remains finished until restarted by one of those changes.

merge preserves array values as arrays when applying deep partial overrides, including indexed overrides inside nested theme palettes.

Agent and design reference

Start with the capability guide for supported exports, props, defaults, composition rules, setup, and recipes. Use the component chooser to select a package. These references describe the repository source; verify your installed package version before copying examples.