Alpine Components
Lazy-loaded components with slots for Alpine.js
.loading.html file.Quick Example
// Register a component
AlpineComponent.register('modal', 'modal/modal.html', 'modal/modal.js');
// Use it in your HTML
<div x-component="modal">
<slot name="header">Custom Title</slot>
</div>Live Demo
Loading...
Installation
npm install alpine-components alpinejsFor the Vite plugin (recommended):
npm install -D vite-plugin-alpine-components