<h1 align="center"><img src="https://github.com/accudio/async-alpine/raw/main/.assets/logo.svg" alt="Async Alpine"></h1>

<p align="center">
  <em>Code splitting and lazy-loading components for <a href="https://alpinejs.dev">Alpine.js</a>!</em><br><br>
</p>

Async Alpine is a wrapper around the Alpine.js JavaScript framework that allows you to load components asynchronously on-demand.

Alpine.js is a fantastic framework but with a large site with lots of components, the bundle size can start to become a performance problem!

Async Alpine allows you to split your components into multiple component files and only load them when they're needed, speeding up your first load!

## Installation

Using a CDN:

```html
<script defer src="https://cdn.jsdelivr.net/npm/async-alpine@2.x.x/dist/async-alpine.script.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
```

Using [npm](https://www.npmjs.com/package/async-alpine):

```sh
npm install async-alpine
```

For more info check out our [Getting Started guide](https://async-alpine.dev/docs/).

## Documentation

Read our [full documentation](https://async-alpine.dev/docs/) on our website.

## Issues, Support, Requests and Contributions

If you've found an incompatibility, bug, limitation or have a feature request [file an issue](https://github.com/accudio/async-alpine/issues) and we'll take a look.

For advice on how best to install or use Async Alpine or general questions about the project [create a Discussion](https://github.com/accudio/async-alpine/discussion).

Have you found some bugs you want to help us fix, or do you have some great ideas that would improve Async Alpine? That's great! Before diving in [file an Issue](https://github.com/accudio/async-alpine/issues) and let us know what you're planning and we can get you contributing!

## License and Credits

This project is licensed under the Apache-2.0 license.

The full license is included at [LICENSE.md](/accudio/async-alpine/blob/main/LICENSE.md), or at [apache.org/licenses/LICENSE-2.0](https://apache.org/licenses/LICENSE-2.0).

Copyright © [Alistair Shepherd](https://alistairshepherd.uk).
