- A modern lightweight Javascript framework - A jQuery replacement
- Despite being lightweight, it manages to encapsulate almost all the functionalities
x-data
defines a chunk of HTML as an Alpine component and provides the reactive data for that component to reference.
Everything in Alpine always starts with the x-data
directive
Because x-data
is evaluated as a normal Javascript object, you can store object, method for it
Parsing Alpine data from external JS
Allowing you easily run code on dispatched DOM events
List events support:
x-bind
allows you to set HTML attributes on elements based on the result of JS expressions
2 attributes set the content of an element to the result.
x-text
will be set text content (HTML in content will be escaped)x-html
will be set the innerHTML
The @astrojs/alpine
integrations adds Alpine
to the global window object. For IDE autocompletion, add the following to your src/env.d.ts
You can extend Alpine by setting the endpoint
option to root-relative