Docs
AlpineJS plugins

AlpineJS plugins

Overview of AlpineJS plugins integrated into Zermatt and instructions for adding new plugins.

Plugins embedded in Zermatt

Zermatt is shipped with the following AlpineJS plugins:

Adding other plugins

Navigate to the web/zermatt directory of your theme.

Run npm install @alpinejs/<plugin>. Ex: npm install @alpinejs/anchor

Update the zermatt.js like this:

import Config from './zermatt-lock.json'
import Zermatt from 'zermatt-core'
 
// Import new AlpineJS plugins
import anchor from '@alpinejs/anchor'
import resize from '@alpinejs/resize'
 
// Use AlpineJS plugins on Zermatt init.
Zermatt.Event.once('zermatt:init', () => Alpine.plugin(anchor, resize))
 
Zermatt.init(Config)