Alpine.js is now available on DefinitelyTyped, you can load them using npm install @types/alpinejs
.
Hmm there’s now
@types/alpinejs
(github.com/DefinitelyTyped/DefinitelyTyped/pull/58130)— Jesse Dobbelaere (@JesseDobbelaere) January 14, 2022
A quick gotcha with @Alpine_JS . Make sure to use this.close() in the x-data object. If it’s just close() then that’s window.close() and well…it’ll close the browser lol!
— Kyle Williams (@kylewcode) January 13, 2022
Alpine JS Tip💡
Use$nextTick()
and refs to auto focus an input.@Alpine_JS #alpinejs #alpine_js
— Sean (@shornuk) January 11, 2022
❗️A quick reminder that arrays are always passed by reference in Javascript, so be careful with passing array data into an @alpinejs component.
If you only assign the array argument instead of cloning it, every component instantiation may overwrite the items of the previous.
— Lupinity Labs | Freelance Software Development (@LupinityLabs) January 8, 2022
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:
image2dots.glitch.me converts your images to dot pattern and is built with Alpine by @gregwolanski (source is avilable at glitch.com/~image2dots)
notioninvoice.com is built with Laravel, Livewire, Alpine and the Notion API by @farez
Demos:
This newsletter supported by my GitHub Sponsors.
Rotating Sponsor Slots with Alpine, WordPress and ACF by @Joey_Farruggio
Features:
Alpine.bound
to retrieve Alpine bound attribute dataAlpine.bind()
to allow global element bindingsAlpine.$data(el)
to get the reactive data scope from any element