Skip to content

Template for creating Alpine JS plugins ๐Ÿ“‹

Notifications You must be signed in to change notification settings

markmead/alpinejs-plugin-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

--- DELETE START ---

Alpine JS Plugin Template

This is a template repository to help developers quickly build Alpine JS plugins.

How to Use

  1. Clone the repository with the "Use this template" button on GitHub
  2. Run npm install to install ES Build
  3. Build your plugin

Compiling

To compile the code you run npm run build which will create two files in the /dist directory.

Testing

In this template you will find a index.html file that you can use for testing how the Alpine JS plugin works.

I recommend using vercel/serve to serve this file.

Things to Change

  • Find and replace "PLUGIN" with the name of your plugin
  • Find and replace "FILE" with the name of your compiled file
  • Find and replace "DESCRIPTION" with a description of your plugin
  • Uncomment "index.html" in the .gitignore file

๐Ÿšจ Make sure find and replace is case sensitive

If you were creating a plugin called "Alpine JS CSV" you could do the following:

  • "PLUGIN" to "alpinejs-csv"
  • "FILE" to "csv"
  • "DESCRIPTION" to "Transform data into a CSV with Alpine JS ๐Ÿ“ˆ"

License

The choice of adding a license and what license is best for your project is up to you.

Adding a License on GitHub

--- DELETE END ---

PLUGIN

DESCRIPTION

Install

With a CDN

<script defer src="https://unpkg.com/PLUGIN@latest/dist/FILE.min.js"></script>

<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>

With a Package Manager

yarn add -D PLUGIN

npm install -D PLUGIN
import Alpine from 'alpinejs'
import FILE from 'PLUGIN'

Alpine.plugin(FILE)

Alpine.start()

Example

Examples of how the plugin works.

Stats

About

Template for creating Alpine JS plugins ๐Ÿ“‹

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published