talira

Alpine.js

Your new, lightweight, JavaScript framework

open sourceMITfree

Alpine.js is a rugged, minimal JavaScript framework for composing behaviour directly in your HTML markup, "like jQuery for the modern web": add one script tag and declare components with attributes such as x-data, x-bind, x-on, x-show, x-model and x-text. The whole API is 15 attributes, 6 properties and 2 methods, and plugins add more. It needs no build step.

Problems it solves

  • add a dropdown or modal to a server-rendered page without React
  • sprinkle interactivity into HTML with a script tag and no build step
  • a lightweight replacement for jQuery
  • bind form inputs to state in plain HTML

Features

  • declarative behaviour in HTML attributes
  • 15 attributes, 6 properties and 2 methods
  • no build step
  • reactive data with x-data and x-model
  • plugins

Capabilities

Takes pluginsplan not known

Alternatives

The same job

These do what Alpine.js does.

  1. Stimulus A modest JavaScript framework for the HTML you already have
  2. htmx High power tools for HTML
  3. Preact Fast 3kB alternative to React with the same modern API
  4. React The library for web and native user interfaces
  5. Vue.js The Progressive JavaScript Framework

Compare Alpine.js with the top 3