Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Alpine.js

No security coverage Maintenance fixes only 1 sites

This module provides the Alpine.js library, a lightweight framework for adding reactive behavior to your website's markup. It allows you to sprinkle interactivity into your DOM without requiring a full JavaScript framework, ensuring compatibility with older browsers.

Alpine.js offers you the reactive and declarative nature of big frameworks like Vue or React at a much lower cost.

You get to keep your DOM, and sprinkle in behavior as you see fit.

This module provides the Alpine.js library for any modules and themes that require it.

The library is installed from CDN, uses the module/nomodule pattern to ensure IE11 and legacy browser support and is also pinned to a specific version number (currently v2.5.0) to avoid unexpected breakage from newer versions.

Usage

1. Install this module as you would install any other Drupal module.

2. Your module or theme should declare Alpine.js module as a dependency:

dependencies:
  - alpinejs

Example: my_awesome_theme.info.yml

name: My Awesome Theme
type: theme
core: 8.x
dependencies:
  - alpinejs

You should also define the dependency in the composer.json file. See https://www.drupal.org/docs/creating-custom-modules/add-a-composerjson-file for more details on how to do that.

3. Include the library (alpinejs/alpine) as a dependency to your module or theme library:

  dependencies:
    - alpinejs/alpine

Example: my_awesome_theme.libraries.yml:

global-scripts:
  version: 1.0
  js:
    dist/index.js: { preprocess: false, minified: true }
  dependencies:
    - core/drupal
    - alpinejs/alpine

Alternatively, you can also attach the library directly in a Twig file:

{{ attach_library('alpinejs/alpine') }}

Versioning

The module versioning is intended to match semantically with Alpine.js versioning.

Alpine.js Drupal module version Alpine.js version 1.0.0 2.4.1 1.1.0 2.5.0 1.2.0 2.6.0 1.4.0 (current) 2.8.0

Ask your assistant about Alpine.js

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Apr 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.4.x-dev Dev 8–10 Apr 17, 2023