├── .gitignore ├── LICENSE ├── README.md ├── builds ├── cdn.js └── module.js ├── dist ├── component.esm.js └── component.min.js ├── package-lock.json ├── package.json ├── scripts └── build.js └── src ├── index.js ├── initStyles.js └── initTemplate.js /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # misc 9 | .DS_Store 10 | *.pem 11 | 12 | # debug 13 | npm-debug.log* 14 | yarn-debug.log* 15 | yarn-error.log* 16 | 17 | # local env files 18 | .env.local 19 | .env.development.local 20 | .env.test.local 21 | .env.production.local 22 | 23 | # testing 24 | index.html 25 | /public 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Mark Mead 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Alpine JS Component 2 | 3 | Reusable HTML components powered by Alpine JS reactivity 🛸 4 | 5 | ## Install 6 | 7 | ### With a CDN 8 | 9 | ```html 10 | 14 | 15 | 16 | ``` 17 | 18 | ### With a Package Manager 19 | 20 | ```shell 21 | npm install -D alpinejs-component 22 | 23 | yarn add -D alpinejs-component 24 | ``` 25 | 26 | ```js 27 | import Alpine from 'alpinejs' 28 | import component from 'alpinejs-component' 29 | 30 | Alpine.plugin(component) 31 | 32 | Alpine.start() 33 | ``` 34 | 35 | ## Example 36 | 37 | ### On Page Components 38 | 39 | You can render on page components by using a `