Use shorthand conditionals when you want to add a class to the element based on an alpine property using x-bind. #laravel #livewire #TALL
— Tushar Gugnani (@tushar_web) May 9, 2022
No need for setting id of the element and accessing it via document.getElementByID
Use x-ref in combination with $refs is for easily accessing DOM elements directly.
See video example of using x-ref in building Stepper component : https://t.co/zqqatNCQXF
— Tushar Gugnani (@tushar_web) May 12, 2022
Made with Alpine.js
If you’ve got something to share with the Alpine.js community, you can submit your link or reach out to me on twitter @hugo__df.
Here are this week’s Alpine.js adopters:
This newsletter supported by my GitHub Sponsors.
Articles & Tutorials
Load Disqus Comments on demand by @luna_dxp
This article from 2020 got resurfaced by @mostafakram: Building an Autocomplete/Typeahead Component with AlpineJS and Livewire
Building Table Sorting and Pagination in Alpine.js by @raymondcamden
Signature Pad with Alpine.js by @irfanmm96
Building a metronome: React vs Alpine by @v1ccenzo
[Video] Coding Shorts: Simple Web Interactivity with Alpine.js by @ShawnWildermuth
Code & Tools
github.com/danharrin/alpine-mousetrap is A simple library for handling keyboard shortcuts with Alpine.js by @danjharrin.