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

@liquid-dom/r3f

v0.1.0

Published

`@liquid-dom/r3f` bridges React Three Fiber, Three's WebGPU renderer, and the React liquid-glass scene. It renders your R3F scene into an intermediate backdrop target, then composites liquid glass over it.

Readme

@liquid-dom/r3f

Description

@liquid-dom/r3f bridges React Three Fiber, Three's WebGPU renderer, and the React liquid-glass scene. It renders your R3F scene into an intermediate backdrop target, then composites liquid glass over it.

Install

pnpm add @liquid-dom/r3f @liquid-dom/react @react-three/fiber react react-dom three

Quick Start

import * as THREE from 'three/webgpu'
import { Canvas, extend } from '@react-three/fiber'
import { LiquidGlassR3F } from '@liquid-dom/r3f'
import {
  Frame,
  Glass,
  GlassContainer,
  Html,
} from '@liquid-dom/react'

extend(THREE as any)

export function App() {
  return (
    <LiquidGlassR3F.Root>
      <Canvas
        gl={async (props) => {
          const renderer = new THREE.WebGPURenderer(props as any)
          await renderer.init()
          return renderer
        }}
      >
        <mesh>
          <boxGeometry />
          <meshBasicNodeMaterial color="hotpink" />
        </mesh>

        <LiquidGlassR3F.Render />
      </Canvas>

      <LiquidGlassR3F.Scene>
        <GlassContainer blur={12} spacing={28}>
          <Frame width={280} height={160}>
            <Glass cornerRadius={44}>
              <Html sizing="fill">
                <button>Native content</button>
              </Html>
            </Glass>
          </Frame>
        </GlassContainer>
      </LiquidGlassR3F.Scene>
    </LiquidGlassR3F.Root>
  )
}

API Overview

Component API

<LiquidGlassR3F.Root>
  <Canvas gl={createWebGpuRenderer}>
    <LiquidGlassR3F.Render renderPriority={1} />
  </Canvas>

  <LiquidGlassR3F.Scene>
    {/* @liquid-dom/react layout */}
  </LiquidGlassR3F.Scene>
</LiquidGlassR3F.Root>
  • LiquidGlassR3F.Root shares the scene ref and invalidation bridge.
  • LiquidGlassR3F.Scene creates a headless LiquidScene for liquid-glass React components.
  • LiquidGlassR3F.Render runs inside the R3F canvas and takes over final rendering with a positive frame priority.
  • LiquidGlassR3F is also callable as the render component, so <LiquidGlassR3F /> is equivalent to <LiquidGlassR3F.Render />.

Component props:

| Component | Props | | --- | --- | | LiquidGlassR3F.Root | children, optional sceneRootRef | | LiquidGlassR3F.Scene | children | | LiquidGlassR3F.Render | sceneRootRef, renderPriority, enabled, dpr, outputTexture, renderTarget, onError | | LiquidGlassR3F | Same props as LiquidGlassR3F.Render |

Hook API

Use useLiquidGlassR3F when you want to own the LiquidScene placement yourself.

import { Canvas } from '@react-three/fiber'
import { useRef, type RefObject } from 'react'
import { LiquidScene, type LiquidSceneRef } from '@liquid-dom/react'
import { useLiquidGlassR3F } from '@liquid-dom/r3f'

function Bridge() {
  const sceneRootRef = useRef<LiquidSceneRef | null>(null)

  return (
    <>
      <Canvas gl={createWebGpuRenderer}>
        <RenderBridge sceneRootRef={sceneRootRef} />
      </Canvas>

      <LiquidScene ref={sceneRootRef}>
        {/* @liquid-dom/react layout */}
      </LiquidScene>
    </>
  )
}

function RenderBridge({
  sceneRootRef,
}: {
  sceneRootRef: RefObject<LiquidSceneRef | null>
}) {
  useLiquidGlassR3F({ sceneRootRef, renderPriority: 1 })
  return null
}

Render Options

LiquidGlassR3F.Render and useLiquidGlassR3F accept:

  • renderPriority: positive R3F frame priority. Defaults to 1.
  • enabled: disables rendering without unmounting resources.
  • dpr: number or function. Defaults to Three's pixel ratio.
  • outputTexture: optional GPUTexture or function returning one.
  • renderTarget: options for the internal Three backdrop target.
  • onError: setup or render error handler.

The hook also accepts sceneRootRef and deferUntilSceneRoot.

Full option reference:

| Option | Type | Description | | --- | --- | --- | | sceneRootRef | RefObject<LiquidSceneRef \| null> | Ref for the LiquidScene to render. Required by useLiquidGlassR3F; optional for the component API when used under Root. | | deferUntilSceneRoot | boolean | Hook-only option that waits for sceneRootRef.current instead of throwing. | | renderPriority | number | Positive R3F frame priority. Defaults to 1. | | enabled | boolean | Enables or disables the bridge. Defaults to true. | | dpr | number \| (state) => number | DPR used by liquid-glass rendering. Invalid values fall back to Three's pixel ratio. | | outputTexture | GPUTexture \| null \| undefined \| (state) => GPUTexture \| null \| undefined | Optional output target. Defaults to the canvas current texture. | | renderTarget | LiquidGlassR3FRenderTargetOptions | Options for the internal Three RenderTarget: colorSpace, depthBuffer, format, samples, stencilBuffer, and type. | | onError | (error: unknown) => void | Called for setup or render failures. If omitted, errors are thrown. |

Exported types are LiquidGlassR3FDpr, LiquidGlassR3FOutputTexture, LiquidGlassR3FRenderTargetOptions, UseLiquidGlassR3FOptions, LiquidGlassR3FRootProps, LiquidGlassR3FSceneProps, LiquidGlassR3FRenderProps, and LiquidGlassR3FProps.

Integration Notes

  • This package requires R3F with an initialized Three WebGPU renderer.
  • DOM-backed Html content from @liquid-dom/react requires the experimental HTML-in-Canvas API, currently available only behind Chrome's Canvas Draw Element flag: chrome://flags/#canvas-draw-element.
  • renderPriority must be positive so the bridge can take over final rendering.
  • The component API wires liquid-scene invalidations into R3F invalidation, including demand-driven frame loops.
  • The hook API is lower-level. If you use it directly, make sure the supplied LiquidScene invalidates R3F when layout or frame state changes.
  • The bridge renders the R3F scene into an internal target before compositing liquid glass.
  • Reference: WICG HTML-in-Canvas.

Local Development

pnpm --filter @liquid-dom/r3f build
pnpm --filter @liquid-dom/r3f watch