VanJS builds reactive web UIs with plain JavaScript functions and DOM APIs, without JSX or a virtual DOM. It ships as a small browser library with state helpers.
Overview
VanJS is a reactive UI framework that composes pages from vanilla JavaScript functions instead of JSX templates. You declare DOM trees as function calls, attach them with van.add, and wire reactive values through van.state and van.derive.
The project emphasizes a grab-and-go workflow: include a script tag or npm package without transpilers, bundlers, or framework-specific tooling for basic use. TypeScript definition files are offered for editor support when you want typing.
Core APIs cover tagging helpers, reactive state, derived state, and hydration for server-rendered markup. Extensions such as VanX add lists, global state, and serialization; Mini-Van targets server-side rendering scenarios mentioned on the project site.
Community add-ons provide routers, form helpers, icons, and JSX wrappers for teams that prefer alternate syntax. Documentation includes a single-page tutorial, examples, and an HTML-to-VanJS converter.
Everything runs in the browser as client-side JavaScript consumed by pages you host or develop locally.
Key features
- Reactive van.state bindings
- DOM composition without JSX
- van.derive computed state
- Client-side routing support via add-ons
- Hydration API
- TypeScript definition files
- CDN and npm distribution
- VanX extension for advanced patterns
Use cases
- Lightweight interactive web widgets
- Small SPAs without build tooling
- Teaching reactive UI with plain JS
- Embedding UI logic in static pages
- Prototyping counters and components quickly