React, Vue, Angular and Svelte already have large, committed user bases, so a new JavaScript library needs a reason to exist. Alpine.js answers that question by aiming at a different job: not building a single page application, but adding a small amount of client-side behavior to existing markup. The library is roughly 7kB gzipped, and its directive syntax borrows from Vue and Angular, so developers with experience in those frameworks will find it familiar.
What Alpine replaces, and what it doesn't
The better comparison for Alpine.js is jQuery and hand-written JavaScript, not the component frameworks. Its selling point is declarative rendering without the architecture of an SPA.
Binding instead of querying
Most of jQuery's code is a cross-browser layer over imperative DOM APIs: jQuery Core's query-and-manipulate features. Alpine.js replaces that with declarative data binding through the x-bind directive, which can bind any attribute to reactive data on the component. When binding isn't enough—say, a third-party library needs an actual DOM node—x-ref offers a direct escape hatch to elements, as in React and Vue.
Events
Event handling goes through the x-on directive and the $event magic value, which passes events into JavaScript functions. To emit custom events, Alpine.js provides the $dispatch magic property, a thin wrapper over the browser's Event and dispatchEvent APIs.
Transitions instead of effects
jQuery's easy animations—slideUp, slideDown, fadeIn, fadeOut—have a counterpart in the x-transition directives, which add and remove classes during an element's transition. The design follows Vue's Transition API. There is no prescriptive replacement for jQuery's Ajax client; the Fetch API or a third-party HTTP library such as axios, ky or superagent covers that ground.
Plugins
The jQuery plugin ecosystem has no equivalent yet. Alpine components are easy to share because their JavaScript is "just functions" that generally don't touch Alpine itself, so they can be dropped onto pages with a script tag; magic properties like $event are supplied at initialization or passed into bindings. No Alpine extensions exist yet, though issues and pull requests propose "core" events that let other libraries hook in, and custom directives are under discussion. Creator Caleb Porzio appears to base API decisions on Vue's APIs, so a future extension point would likely follow Vue as well.
Why the payload is small
Alpine.js measures 21.9kB minified and 7.1kB gzipped, against jQuery at 87.6kB minified and 30.4kB gzipped—about 23% of the size. The gap comes largely from focusing on a declarative DOM API: attribute binding, event listeners and transitions. Vue, for comparison, is 63.5kB minified and 22.8kB gzipped. Alpine stays lighter despite an equivalent API because it has no Virtual DOM; it mutates the DOM directly while exposing the same declarative interface.
Authoring components
Application code is declarative and lives in templates. A Pokémon search page illustrates the pattern: x-data takes a function returning the component's initial data and methods, and x-init runs it on load. The binding and listener syntax closely tracks Vue:
- Alpine:
x-bind:attribute="express"andx-on:eventName="expression"; shorthand:attribute="expression"and@eventName="expression" - Vue:
v-bind:attribute="express"andv-on:eventName="expression"; shorthand:attribute="expression"and@eventName="expression"
Lists render with x-for on a template element, and conditionals with x-if on a template element. Alpine ships no full templating language, so there is no interpolation syntax like {{ myValue }}. Dynamic content is bound with x-text and x-html, which map directly to Node.innerText and Node.innerHTML. The equivalent jQuery approach is several imperative steps: bind to the button click with $('button').click(/* callback */), read the input value from the DOM inside the callback and call the API, then update the DOM with nodes generated from the response. Alex Justesen built the same character counter in both jQuery and Alpine.js for a side-by-side look.
HTML as the source of truth
Alpine's repository introduction calls it "Tailwind for JavaScript," and the inspiration is literal. Tailwind's pitch is low-level utility classes that let you build custom designs without leaving your HTML; Alpine works inside HTML the same way, so there is no need to write in JavaScript templates as with Vue or React. Many community examples use no script tags at all.
An accessible navigation menu built this way ties aria-labelledby and aria-controls to id references outside Alpine. Alpine keeps aria-expanded at true on the toggle button while the menu is open and false when collapsed, applies the same binding to the menu itself, and shows or hides the link list by binding to hidden.
Markup-centric code is also shareable: an example is a copy-paste into HTML already running Alpine and Tailwind, with no directories of templates that compile into HTML. Because HTML underpins the web, Alpine suits server-rendered stacks (Laravel, Rails, Django) and static site generators (Hugo, Hexo, Jekyll). Passing data in can be as simple as outputting JSON into the x-data="{}" binding, which avoids standing up "yet another API endpoint" just to serve a snippet a widget needs.
No build step required
Alpine is designed to be included as a script directly from a public CDN, and its developer experience is tailored to that use, which is what makes the jQuery comparison apt: it drops in and removes the build step. Vue's bundled version can also be linked directly—Sarah Drasner has written up substituting Vue for jQuery—but going buildless means forgoing the Vue CLI, single file components, smaller and more optimized bundles, and a strict Content Security Policy, since Vue inline templates evaluate expressions client-side. Vue's buildless mode exists, yet its experience depends on the CLI, much as React depends on Create React App and Angular on its CLI; stripping the build strips those frameworks of their best qualities.
The net result is a CDN-first library that delivers declarative rendering in a small payload with no build step and none of the templating other frameworks require—an HTML-centric approach that reads like a modern jQuery while serving as a substitute for it, without forcing an SPA architecture.



