Registry / devops / refui
library0.17.4jsnpmunverified

rEFui (0.17.4) is a retained-mode JavaScript framework for building UIs across web, native, and embedded environments. It uses signals for reactivity and a JSX-based component model without requiring a framework-specific compiler — any JSX-capable transpiler (Babel, esbuild, SWC, TypeScript) works out of the box. Built-in HMR support via the refurbish plugin for bundlers. The package ships with LLM-generated TypeScript declarations. Key differentiators: toolchain-agnostic design, unified API across web, NativeScript, and embedded (CheeseDOM/Resonance), and a focus on accessible tooling while delivering high-performance UIs.

npm install refui
INSTALL
IMPORT
SIG · REFUI
R
refui
devopsjavascriptv0.17.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

signal
✓ import { signal } from 'refui'
✗ const { signal } = require('refui')
ESM-only; CJS require will fail. Also type import available in TypeScript.
createDOMRenderer
✓ import { createDOMRenderer } from 'refui/dom'
✗ import { createDOMRenderer } from 'refui'
createDOMRenderer is a subpath export from refui/dom, not from the main package.
defaults
✓ import { defaults } from 'refui/browser'
✗ import { defaults } from 'refui'
defaults is a browser-specific export from refui/browser.
R
✓ import R from 'refui'
✗ import { R } from 'refui'
R is a default export (the core module), not a named export. Used as JSX factory when configured.
t
✓ import { t } from 'refui'
✗ import { t } from 'refui/template'
The tagged template literal function t is exported directly from 'refui'.

Shows basic state management with signals and rendering to the DOM using rEFui's DOM renderer.

import { signal } from 'refui'; import { createDOMRenderer } from 'refui/dom'; import { defaults } from 'refui/browser'; const DOMRenderer = createDOMRenderer(defaults); const App = () => { const count = signal(0); const increment = () => { count.value += 1; }; return ( <> <h1>Hello, rEFui</h1> <button on:click={increment}>Click me! Count is {count}</button> </> ); }; DOMRenderer.render(document.body, App);
Debug
Known issues
gotchaImport paths differ: signal/t from main, createDOMRenderer from refui/dom, defaults from refui/browser. Using wrong import path will cause runtime errors.
fix
Use correct subpath imports: 'refui' for core, 'refui/dom' for DOM renderer, 'refui/browser' for browser defaults.
affects: >=0.0.1
gotchaESM-only package — CJS require() will fail.
fix
Use import syntax or configure your bundler for ESM.
affects: >=0.0.1
gotchaTypeScript declarations are LLM-generated and may contain errors. Users may encounter type mismatches.
fix
Report issues on GitHub or manually augment types. Consider using // @ts-ignore as temporary workaround.
affects: >=0.0.1
breakingThe JSX factory and fragment must be configured as 'R.c' and 'R.f' respectively, not React.createElement.
fix
Set jsxFactory to 'R.c' and jsxFragment to 'R.f' in your transpiler config, or set jsxImportSource to 'refui' if using react-jsx transform.
affects: >=0.0.1
gotchaEvent handlers use on:eventname syntax (e.g., on:click) instead of standard onClick.
fix
Use on:click, on:tap, etc. as JSX attributes. See documentation for supported events.
affects: >=0.0.1
deprecatedSome older examples may use ()=> syntax for signal values. Ensure count.value is used to get/set signals.
fix
Always use signal.value to access and mutate signals. Do not treat them as functions.
affects: >=0.10.0
Errors
Common errors & fixes
Cannot find module 'refui/dom' or 'refui/browser'
Package does not expose these subpaths or bundler does not support exports field.
fix
Ensure your bundler (Webpack 5+, Vite, etc.) respects the package.json 'exports' field. For Node.js, use at least version 12.20.
Uncaught TypeError: signal is not a function
Using default import incorrectly — 'signal' is a named export, not default.
fix
Use import { signal } from 'refui' instead of import signal from 'refui'.
JSX element type 'div' does not have any construct or call signatures
TypeScript declarations for JSX intrinsic elements may be incomplete or missing.
fix
Install @types/react as a workaround or suppress with // @ts-ignore. Consider contributing type fixes.
Cannot use JSX unless the '--jsx' flag is provided
TypeScript compilation requires JSX support enabled.
fix
Set 'jsx': 'react-jsx' and 'jsxImportSource': 'refui' in tsconfig.json, or set jsxFactory/R.c and jsxFragment/R.f.
Upgrade
Version history
0.17.4latest on npm
Audit
Dependencies
refurbishoptionalHMR plugin for bundlers (Bun, Vite)
Agent activity
2 hits · last 30 days
node
2
Resources
packagerefui ↗
refui — npm install refui · libregistry