Installation
There are two ways to install Toolbelt. In either case, it might be helpful to read through how installation works for Alpine core. The following guide skips some details that are already covered in Alpine’s documentation.
From a script tag
The easiest way to install Toolbelt is to include its CDN link. Because Toobelt is an Alpine plugin, you will have to include Alpine as a dependency. In addition, the Focus plugin is a required dependency for Toolbelt. Notice that Toolbelt and Alpine plugins come before Alpine core.
-
Include the following script tags in your
<head>
: -
You can now use Toolbelt components in your markup. Make sure to read through Using the Components before proceeding.
As a module
If you prefer bundling Toolbelt and its dependencies in your own Javascript bundle, you can install these packages from the npm registry.
-
Install the following packages:
-
Import and initialize the packages like so:
-
You can now use Toolbelt components in your markup. Make sure to read through Using the Components before proceeding.