MCPcopy Index your code
hub / github.com/vanjs-org/van

github.com/vanjs-org/van @1.6.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.6.0 ↗ · + Follow
5,130 symbols 12,803 edges 544 files 0 documented · 0% 2 cross-repo links updated 4mo ago1.6.0 · 2025-09-24★ 4,39332 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Gurubase

🍦 VanJS: The Smallest Reactive UI Framework in the World

📣 Introducing VanX →

🖊️ Get Started 📖 Tutorial 📚 Examples 📝 HTML/MD to VanJS Converter ⚔️ VanX 💬 Discuss

Enable everyone to build useful UI apps with a few lines of code, anywhere, any time, on any device.

VanJS is an ultra-lightweight, zero-dependency and unopinionated Reactive UI framework based on pure vanilla JavaScript and DOM. Programming with VanJS feels like building React apps in a scripting language, without JSX. Check-out the Hello World code below:

// Reusable components can be just pure vanilla JavaScript functions.
// Here we capitalize the first letter to follow React conventions.
const Hello = () => div(
  p("👋Hello"),
  ul(
    li("🗺️World"),
    li(a({href: "https://vanjs.org/"}, "🍦VanJS")),
  ),
)

van.add(document.body, Hello())
// Alternatively, you can write:
// document.body.appendChild(Hello())

Try on jsfiddle

You can convert any HTML or MD snippet into VanJS code with our online converter.

VanJS helps you manage states and UI bindings as well, with a more natural API:

const Counter = () => {
  const counter = van.state(0)
  return div(
    "❤️ ", counter, " ",
    button({onclick: () => ++counter.val}, "👍"),
    button({onclick: () => --counter.val}, "👎"),
  )
}

van.add(document.body, Counter())

Try on jsfiddle

Why VanJS?

Reactive Programming without React/JSX

Declarative DOM tree composition, reusable components, reactive state binding - VanJS offers every good aspect that React does, but without the need of React, JSX, transpiling, virtual DOM, or any hidden logic. Everything is built with simple JavaScript functions and DOM.

Grab 'n Go

No installation, no configuration, no dependencies, no transpiling, no IDE setups. Adding a line to your script or HTML file is all you need to start coding. And any code with VanJS can be pasted and executed directly in your browser's developer console. VanJS allows you to focus on the business logic of your application, rather than getting bogged down in frameworks and tools.

Ultra-Lightweight

VanJS is the smallest reactive UI framework in the world, with just 1.0kB in the gzipped minified bundle. It's 50~100 times smaller than most popular alternatives. Guess what you can get from this 1.0kB framework? All essential features of modern web frameworks - DOM templating, state, state binding, state derivation, effect, SPA, client-side routing and even hydration!

Size comparison

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.

-- Antoine de Saint-Exupéry, Airman's Odyssey

Easy to Learn

Simplicity at its core. Only 5 functions (van.tags, van.add, van.state, van.derive, van.hydrate). The entire tutorial plus the API reference is just one single web page, and can be learned within 1 hour for most developers.

Performance

VanJS is among the fastest web frameworks, according to the results by krausest/js-framework-benchmark. For SSR, Mini-Van is 1.75X to 2.25X more efficient compared to React.

TypeScript Support

VanJS provides first-class support for TypeScript. With the .d.ts file in place, you'll be able to take advantage of type-checking, IntelliSense, large-scale refactoring provided by your preferred development environment. Refer to the Download Table to find the right .d.ts file to work with.

Want to Learn More?

IDE Plug-ins

See Also

A Guide to Reading VanJS Codebase

Support & Feedback

🙏 VanJS aims to build a better world by reducing the entry barrier of UI programming, with no intention or plan on commercialization whatsoever. If you find VanJS interesting, or could be useful for you some day, please consider starring the project. It takes just a few seconds but your support means the world to us and helps spread VanJS to a wider audience.

In the name of Vanilla of the House JavaScript, the First of its name, Smallest Reactive UI Framework, 1.0kB JSX-free Grab 'n Go Library, Scripting Language for GUI, GPT-Empowered Toolkit, by the word of Tao of the House Xin, Founder and Maintainer of VanJS, I do hereby grant you the permission of VanJS under MIT License.

Contact us: @taoxin / tao@vanjs.org / Tao Xin

Community Add-ons

VanJS can be extended via add-ons. Add-ons add more features to VanJS and/or provide an alternative styled API. Below is a curated list of add-ons built by VanJS community:

Add-on Description Author
Van Cone An SPA framework add-on for VanJS b-rad-c
van_element Web Components with VanJS Atmos4
VanJS Prerender SSR support for VanJS (alternative to Mini-Van) Binh Tran
VanJS Feather Feather Icons for VanJS thednp
van_dml.js A new flavour of composition for VanJS Eckehard
van-jsx A JSX wrapper for VanJS, for people who like the JSX syntax more cqh963852
vanjs-router A router solution for VanJS (README.md in simplified Chinese) 欧阳鹏
VanJS Routing Yet another routing solution for VanJS Kwame Opare Asiedu
VanJS Form Fully typed form state management library (with validation) for VanJS Kwame Opare Asiedu
vanjs-bootstrap VanJS Bootstrap Components Willi Commer
vanrx An ultra-lightweight Redux addon for VanJS Meddah Abdallah
VanFS 1:1 bindings from F# to VanJS Ken Okabe
Van-wrapper A tool that facilitates the rendering of VanJS elements within other popular frameworks Zakaria Elalaoui
Create VanJS The fastest way to kickstart your first VanJS Project: npm create vanjs@latest thednp
Vite Plugin for VanJS A mini meta-framework for VanJS featuring routing, metadata, isomorphic rendering and JSX transformation thednp
Vite VanJS SVG A Vite plugin to transform SVG files to VanJS components on the fly thednp
VanJS Lucide Lucide Icons for VanJS thednp
P5.wrapper A p5.js wrapper for VanJS built on top of ZikoJS Zakaria Elalaoui
Van-Mdx A Markdown preprocessor for VanJS Zakaria Elalaoui
Van-Server Server-side rendering for VanJS with file-based routing and client-side hydration Zakaria Elalaoui

Contributors (67)

If I miss anyone's contribution here, apologies for my oversight 🙏, please comment on #87 to let me know.

Emoji key

Tao Xin Tao Xin 🎨 💻 📖 💡 Wei Sun Wei Sun 🐛 Ryan Olson Ryan Olson 🖋 Tamotsu Takahashi Tamotsu Takahashi 💻 icecream17 icecream17 💻 enpitsulin enpitsulin 💡 💻 Elliot Ford Elliot Ford

Extension points exported contracts — how you extend this code

State (Interface)
(no doc)
public/van-1.2.3.min.d.ts
State (Interface)
(no doc)
public/van-1.2.8.d.ts
State (Interface)
(no doc)
public/van-1.2.7.debug.d.ts
State (Interface)
(no doc)
public/van-1.5.0.d.ts
StateView (Interface)
(no doc)
public/van-0.12.0.d.ts
StateView (Interface)
(no doc)
public/van-0.11.11.debug.d.ts
State (Interface)
(no doc)
public/van-1.4.0.min.d.ts
State (Interface)
(no doc)
public/van-1.2.7.d.ts

Core symbols most depended-on inside this repo

setter
called by 338
public/van-0.9.3.js
replaceWith
called by 303
addons/van_prerender/src/index.js
remove
called by 250
components/van-ui.ts
toString
called by 245
addons/van_prerender/src/index.js
setAttribute
called by 181
addons/van_prerender/src/index.js
append
called by 130
addons/van_prerender/src/index.js
addEventListener
called by 71
addons/van_prerender/src/index.js
removeEventListener
called by 58
addons/van_prerender/src/index.js

Shape

Function 4,451
Interface 424
Method 139
Class 116

Languages

TypeScript100%

Modules by API surface

addons/van_jsx/src/type.d.ts58 symbols
test/van.test.ts39 symbols
test/van.test.nomodule.js37 symbols
test/van.test.js35 symbols
public/van-1.3.0.nomodule.debug.js35 symbols
public/van-1.2.8.nomodule.debug.js35 symbols
public/van-1.2.7.nomodule.debug.js35 symbols
public/van-1.2.6.nomodule.debug.js35 symbols
public/van-1.2.5.nomodule.debug.js35 symbols
public/van-1.2.4.nomodule.debug.js35 symbols
public/van-1.2.3.nomodule.debug.js35 symbols
public/van-1.2.1.nomodule.debug.js35 symbols

Dependencies from manifests, versioned

@types/bun1.1.6 · 1×
@viz-js/viz3.8.0 · 1×
all-contributors-cli6.26.1 · 1×
bun1.0.0 · 1×
deno-bin1.43.1 · 1×
esbuild0.25.3 · 1×
mini-van-plate0.6.3 · 1×
node-jq6.0.1 · 1×
terser5.22.0 · 1×
typescript5.1.6 · 1×
vanjs-core1.6.0 · 1×
vanjs-ext0.6.3 · 1×

For agents

$ claude mcp add van \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact