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

@liquiddom/react

v0.2.0-rc.0

Published

React bindings for liquiddom

Downloads

93

Readme

@liquiddom/react

React 18+ bindings for liquiddom — WASM-driven soft-body physics on real DOM elements.

Install

npm install liquiddom @liquiddom/react react react-dom

liquiddom is a peer dependency so a single WASM instance is shared across your app.

Quickstart

import { LiquidProvider, LiquidElement } from "@liquiddom/react";

export default function App() {
  return (
    <LiquidProvider config={{ capacity: 16, theme: { fusionRadius: 50 } }}>
      <LiquidElement as="button">Click me</LiquidElement>
      <LiquidElement as="a" href="#">Also liquid</LiquidElement>
    </LiquidProvider>
  );
}

Three usage patterns

1. <LiquidElement> — drop-in tag

Easiest. Wraps useLiquidRef and observes on mount.

<LiquidElement as="button" liquidType={4 /* Shake */}>
  Shaky
</LiquidElement>

2. useLiquidRef — ref on your own element

When you need full control over the element (custom components, third-party libs).

import { useLiquidRef } from "@liquiddom/react";

function Card() {
  const ref = useLiquidRef<HTMLDivElement>({ liquidType: 3 /* Dragged */ });
  return <div ref={ref} className="my-card">Drag me</div>;
}

3. useLiquid — imperative access

For one-off actions like impulse(), tween(), spawnDroplet().

import { useLiquid, useLiquidRef } from "@liquiddom/react";

function Button() {
  const liquid = useLiquid();
  const ref = useLiquidRef<HTMLButtonElement>();

  return (
    <button
      ref={ref}
      onClick={() => liquid?.impulse(ref.current!, { magnitude: 20 })}
    >
      Splash me
    </button>
  );
}

API

| Export | Description | |--------|-------------| | <LiquidProvider config?> | Owns a LiquidDOMInstance via React Context. config is captured once on mount — re-renders don't re-create the instance. | | useLiquid() | Returns the active instance, or null before init / outside a provider. | | useLiquidRef<T>(opts?) | Callback ref that auto-observes on mount, unobserves on unmount. opts.liquidType captured at first attach. | | <LiquidElement as? liquidType? ...rest> | Convenience tag — internally uses useLiquidRef. Forwards all other props to the underlying element. |

Notes

  • Strict-mode safeuseLiquidRef observes idempotently, so React 18's double-mount in dev doesn't double-register.
  • SSR-safe — the provider effect is gated on typeof window, so server rendering is a no-op.
  • Single instance per provider — nested providers each spin up their own WASM instance. For most apps, one provider at the root is correct.

Full options + imperative API

All options and methods exposed via config and useLiquid() come straight from liquiddom's core API.

License

MIT © Dennis Schmock