Skip to content
Voodoo.js 1.1.0: JSX in plain HTML

Write the spell in plain HTML. Watch it run.

JSX, reactive directives, components, HTTP and a router in one script tag. No bundler, no JSX transform, no build step. Pick a spell, edit the file, and watch the result run right next to it.

counter.html
counter.html
Brewing the result
<script src="https://cdn.jsdelivr.net/npm/voodoojs@1.1.0/dist/voodoo.full.min.js" defer></script>

No build step

The file you edit is the file the browser runs

JSX usually needs a toolchain between your editor and the page. Voodoo reads the JSX at runtime, so there is nothing to install, configure or wait for. Open the file, even straight from your disk, and the spell is cast.

An open spell book whose left page holds HTML with Voodoo directives An open spell book whose left page holds HTML with Voodoo directives
The usual ritual
# 1. scaffold a project
npm create vite@latest my-app -- --template react
cd my-app
# 2. install a few hundred packages
npm install
# 3. a JSX transform, a bundler, a dev server
npm run dev
# 4. and before anyone can open it
npm run build
# 5. deploy dist/, not the files you wrote
index.html
<script src="https://cdn.jsdelivr.net/npm/voodoojs@1.1.0/dist/voodoo.full.min.js" defer></script>

{
  const fruits = ['apple', 'pear', 'grape'];
}

<ul>
  {fruits.map((fruit) => (
    <li>{fruit}</li>
  ))}
</ul>

The honest cost: a compiler turns JSX into DOM calls ahead of time and Voodoo reads it at runtime, so a compiled framework wins on raw update speed and ships a smaller bundle. What you get back is a file you can open, edit and send to someone, with no node_modules anywhere in the story.

Three potion bottles labelled v-data, v-model and v-for Three potion bottles labelled v-data, v-model and v-for

Directives

A grimoire of attributes

Behaviour is written where it belongs, on the element it changes. Once a directive is read, its attribute leaves the document, so what the browser keeps is ordinary HTML.

95 directives No eval, strict CSP friendly

  • v-data

    Reactive state for an element and everything inside it.

    <div v-data="{ open: false }">
  • { expression }

    Any expression, or JSX, straight into the markup.

    <p>Hello, { user.name }</p>
  • @event

    Events, with modifiers such as prevent, outside and debounce.

    <form @submit.prevent="save()">
  • v-model

    Two-way binding for inputs, selects, checkboxes and components.

    <input v-model.trim="email">
  • v-for

    Keyed lists, so a reorder moves nodes instead of rebuilding them.

    <li v-for="t in todos" :key="t.id">
  • v-if

    Conditionals with v-else-if and v-else, or v-show to keep the node.

    <p v-if="error">{ error }</p>
  • :attr

    Bind any attribute, class or style to state.

    <a :href="url" :class="{ active }">
  • v-resource

    An HTTP request with its data, loading and error state.

    <div v-resource="users: /api/users">
  • v-validate

    Forms that validate, mask and submit themselves.

    <input name="email" v-required v-email>

Components

Components you write as tags, never install

The library defines them when it starts, so the tag is the whole usage. They work with v-model and the validation directives, and every one below is running on this page.

29 built-in components

A ring of runes around a pair of curly braces A ring of runes around a pair of curly braces
<v-button>
SaveCancel
<v-input>
<v-switch> <v-checkbox>
<v-rating> <v-progress>
<v-alert> <v-badge> <v-tag> The library starts itself.
ActiveOverduedesignfrontend
<v-steps> <v-stat> <v-avatar>

Measured

Quick where it counts, honest where it is not

Seven implementations of the same 1,000 row list, all bundled for production, run back to back against the same document. Median of 30 samples in milliseconds, lower is better. A framework whose DOM differs from the hand-written baseline is excluded rather than timed.

Update 1 in 10

4.69 ms

ahead of hand-written vanilla, at 6.65

Clear 1,000 rows

30.14 ms

level with Preact, Vue and React

Create 1,000 rows ms, lower is better
  1. vanilla JS39.51
  2. Preact 10.29.871.03
  3. Voodoo.js 1.1.077.47
  4. Vue 3.5.4278.72
  5. Solid 1.9.1580.13
  6. React 19.2.881.22
  7. Alpine 3.17.1157.06

Read honestly: on create Voodoo is third of seven, and vanilla still builds the list twice as fast. Solid and Preact update faster, with a compiler. Voodoo is also the largest bundle here, so if size is your main constraint, Alpine and Preact are the honest recommendation.

The method, the raw numbers and how to run it yourself

Cast your first spell in a minute

One script tag, or npm install voodoojs when you have a bundler anyway. This site is built with it, with no build step and no framework code of its own: view the source.

A wand leaving a trail of sparkles A wand leaving a trail of sparkles