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

@blender-ui/native

v0.6.0

Published

Blender's UI from JavaScript: native windows (CPU or Direct3D 11), HTML elements, CSS and Tailwind classes, signals. Node.js and Bun, through napi-rs.

Readme

@blender-ui/native

npm license

BUI, Blender's UI toolkit, from JavaScript. It gives you native windows drawn on the CPU or the GPU (Direct3D 11 on Windows, OpenGL 3.3 on Linux), HTML elements, CSS and Tailwind classes, Blender components (NumberSlider, Button ...), and signals. It runs on Node.js and Bun through a napi-rs addon, and bui build turns an app into a single executable of about 5 MB. There's no browser and no webview.

For React, use @blender-ui/react; for Svelte, @blender-ui/svelte. Both are built on this package.

npm install @blender-ui/native        # or: bun add @blender-ui/native
const { App, signal } = require('@blender-ui/native')

const app = new App({ gpu: true })
const win = app.window({ title: 'Hello', width: 360, height: 200 })
win.body.className = 'm-0 p-6 flex flex-col gap-3 bg-[#2b2b2b] text-[#e6e6e6]'

const clicks = signal(0)
const label = win.createElement('span')
label.textContent = clicks            // follows the signal
const button = win.createElement('button')
button.textContent = 'Add one'
button.addEventListener('click', () => clicks.value++)
win.body.appendChild(label)
win.body.appendChild(button)

API

  • A DOM-like tree: createElement, createTextNode, appendChild, insertBefore, removeChild, setAttribute, className (Tailwind classes included), style (a string or an object), textContent.
    • Moving nodes and the error cases behave as in the DOM; siblings are a linked list.
    • before / after / append / replaceWith, cloneNode, dispatchEvent, el.style.setProperty, el.classList, and DOM properties that reflect attributes (disabled, value, checked ...).
    • destroy() frees a removed subtree natively.
  • document: a window-less document whose nodes are detached until inserted into a window's tree; fragments, and comments as anchors. A removed node made by document is freed natively at the end of the tick unless it was reinserted.
  • For framework bindings: @blender-ui/native/host (open, blenderWidgets, applyProps: what React's and Svelte's bindings share), @blender-ui/native/globals (document, window and the node classes as globals, for DOM-based frameworks), and bui build bundling with the Bun plugin a @blender-ui/* package declares ("bui": { "bunPlugin" }).
  • Events: addEventListener for click, dblclick, auxclick, contextmenu, the mouse* and pointer* events (pointerdown, pointerup, pointermove, pointerenter, pointerleave, pointerover, pointerout, pointercancel, gotpointercapture, lostpointercapture), wheel, keydown, keypress, keyup, focus, blur, focusin, focusout, scroll, pressdrag (Blender's press-drag), input, change, and the touch screen / trackpad gestures pinch (delta: the scale change), rotate (delta: degrees, counter-clockwise) and pan (deltaX / deltaY: pixels the content follows the fingers; phase: drag, fling or end) arrive from the UI thread; other types fire through dispatchEvent.
    • They capture and bubble through the tree (addEventListener(type, fn, { capture: true, once: true })), and stopPropagation() works. el.setPointerCapture() keeps the pointer for an element.
    • An element listening for pan takes the drag, as CSS's touch-action: none: nothing under it scrolls by touch.
    • They arrive after BUI has handled them, so preventDefault() only marks the event.
  • Frames and measurement: win.requestAnimationFrame(cb) is paced by the display. el.getBoundingClientRect() and win.screenshot() return promises.
  • Signals: signal, memo, effect, batch, untrack, startTransition.
    • Pass a signal to setAttribute, style (or inside a style object), textContent or createTextNode, and its changes update that node alone.
    • Memos and effects track what they read, are glitch-free, and need no dependency arrays.
    • Without the addon: require('@blender-ui/native/signals').
  • Animation: GSAP's and Motion's APIs, run by BUI's engine (Rust and C: JavaScript hands over each call's objects once and hears only the callbacks it asked for).
    • @blender-ui/native/gsap: gsap.to / from / fromTo / set / timeline / delayedCall, timelines with GSAP's positions ('<', '+=1', labels), the tween controls, callbacks, await tween, CustomEase, every ease name of GSAP, Motion, CSS and Blender. Targets: selectors, elements, motion values, a plain object's numbers.
    • @blender-ui/native/motion: animate (elements, motion values, animate(0, 100, { onUpdate })), motionValue, stagger.
    • Every element takes Motion's props: el.setMotion('animate', { x: 100 }) (initial, animate, exit, whileHover, whileTap, whileFocus, transition, variants), and style = { x: motionValue }.
    • el.animate(keyframes, options) (Web Animations) runs for real (cancel() leaves the first keyframe applied until the engine can revert a style).
    • Numbers are checked at the call: NaN or infinite times throw a RangeError, a negative duration is 0, repeat: -1 is forever, a position outside GSAP's grammar throws (docs/animation-api.md, "Numbers and positions"). Svelte's transitions run on the engine through el.animate().
  • Desktop shell: app.createTray({ icon, tooltip, menu }), app.notify({ title, body }), app.addRecentDocument(path) and win.setProgressBar(progress), with Electron's names; createTray and notify resolve to null where the system has no tray or notifications.
  • Tests: new App({ headless: true }) renders off-screen, and win.click(x, y) simulates input. Its clock stands still: await app.advanceClock(ms) steps animations frame-exactly.
  • Looks and theme: plain HTML looks like a browser's; the styled attribute gives an element and its subtree Blender's look; the Blender components (win.createElement('NumberSlider'), 'Button', 'Checkbox' ...) are Blender's widgets anywhere. new App({ theme: 'light' }) or app.setTheme('light') (or BUI_THEME=light) switches Blender's theme.

Standalone apps

npx bui build app.js           # app.exe: BUI + embedded QuickJS, ~5 MB
npx bui build app.js --bun     # app.exe: Bun, with Node's APIs and a JIT, ~115 MB
npx bui run app.js             # run on the QuickJS runtime, no build
npx bui bundle app.jsx -o main.js  # the one script QuickJS runs (Android: platform/android/build.py --js)

Options:

  • -o <file>: the output file.
  • --console: keep a console window for logs (Windows builds open none).
  • --dev: development builds (React's, Svelte's dev mode).
  • --features a,b: the kit features the app uses (default: package.json's "bui": {"features": [...]}, else detected in the bundle).
  • --gpu d3d11|d3d12: Windows: the Direct3D the GPU renderer starts with (BUI_GPU_API overrides it when the app runs).
  • --msix: Windows: an MSIX package instead of a bare .exe (bui package app.exe --msix releases any BUI executable the same way).

Bundling uses Bun, so it must be installed.

How the default build works. It appends your bundled app to bui-runtime, BUI with the QuickJS engine embedded. That takes under a second and compiles nothing.

  • It's fast to start: the result reaches its first frame in about 70 ms and uses 19 MB of RAM there.
  • It's limited: no Node modules (fs and the like) and no JIT. Keep frequent updates on signals, or use --bun.

How it's fast

  • Its own UI thread: BUI renders on a thread of its own, so it never blocks JavaScript, and an idle window uses no CPU.
  • Only changes cross: each tick, a window sends one batch of operations, an Int32Array and a string table.
  • Styles parsed once: a style value is parsed when it's set, not every frame.

Benchmarks

Ryzen 7 5800U laptop, Windows 11, GPU renderer, measured before the latest features landed. Method: guide.

| Startup (small app, quits at first frame) | First frame | Launch to exit | RAM | Size | |---|---:|---:|---:|---:| | bui build (QuickJS) | 68 ms | 104 ms | 19 MB | 4.9 MB | | bui build --bun | 79 ms | 147 ms | 35 MB | 114 MB | | bun app.js | 80 ms | 152 ms | 35 MB | | | node app.js | 108 ms | 187 ms | 45 MB | |

| 3,000 cells, one changing per frame | FPS | CPU per frame | RAM | |---|---:|---:|---:| | Bun | 58.8 | 13.1 ms | 80 MB | | Node.js | 55.8 | 14.4 ms | 88 MB | | QuickJS (bui build) | 59.1 | 16.3 ms | 56 MB | | Rust, for reference | 59.6 | 12.0 ms | 43 MB |

Requirements

  • Prebuilt for Windows x64. Elsewhere, build from a clone of the repository with npm run build in bindings/node (you need Rust, CMake and a C compiler).
    • Linux: built from source, windows are native X11 windows (Wayland through XWayland), on the CPU or OpenGL. Building needs the X11 headers.
    • macOS: headless only for now (headless: true): BUI runs on its own UI thread under Node, and macOS only allows windows on the main thread.
  • Runtimes: Node.js 18 or newer, or Bun.

Guide: docs/javascript.md · Website: bui.preetham.top · Source: github.com/ppmpreetham/BUI · License: GPL-3.0-or-later