VRUI is a TypeScript library for building browser interfaces from real DOM elements and signals. You style elements with utility class names, and VRUI writes the CSS for the classes you use while the page runs. You don't need a stylesheet, a CSS build step, or a virtual DOM.
Every element factory, such as div or button, returns a real HTMLElement. You can hand it to any library that takes a DOM node. When a signal changes, VRUI updates the text or attribute that reads it and leaves the rest of the page alone.
The class names follow Tailwind, but spacing, type size, radius, shadow and color come from fixed scales. A class like w-[13px] throws an error, so one-off values can't creep in. Colors go through roles such as accent and danger, and the theme decides which palette each role uses.
VRUI ties listeners, timers and observers to the part of the page that started them. When that part is removed, VRUI stops them too.
The library is 3,900 lines of TypeScript and about 14 KB minified and gzipped. Its only dependency is Lucide, for icons.
VRUI includes vrui-check, which reads your source and reports these kinds of problems:
- class names VRUI doesn't generate, which otherwise do nothing and show no error
- browser work VRUI already owns, such as event listeners, timers, DOM edits and style writes, that VRUI can't clean up
- the same class list repeated in several places, which should become a component, and near copies that differ by one class, such as a title that is
font-mediumhere andfont-semiboldthere - colors and icon sizes outside the steps your app has chosen
Run it with your other checks. It helps most when an AI agent writes your UI, because the agent can read the report and fix each problem itself.
Install VRUI and Lucide from GitHub with bun add github:vaakx-dev/vrui lucide. npm works too, and builds the package during install. Bun uses the TypeScript source directly.
Read Application structure first. It shows how to lay out a small app and when to split it up. The examples folder has two complete apps: a task list and a multi-page workshop manager.
VRUI is in alpha, and the API can change between releases. Each GitHub release, such as v0.1.0-alpha.1, never changes. main has every change as soon as it's pushed.