Alpine and Pictionary Jams

2024-04-08


Hey friends,

Spring has sprung, and so have my sinuses! 👃🌼


Thinking Too Hard

This week I got to use Alpine.js for a content site build... and I like it!

I'm not in a rush to replace everything with it, but for the limited 'sprinkle' pattern where there's just some limited and light interactivity, it's a SOLID choice.

One of my favorite features is it's concept of DOM scoping: when you tell Alpine that an element is interactive, it carries it's scope DOWN the DOM tree, but not up — it's not global. That means each dropdown in a menu only has to worry about it's current local state. Rather than an array of indexes to manage you can have each section manage itself. It also does away with having to query for an element because you attach it DIRECTLY TO the element.

Good stuff!


Interesting Web Bits


Don't miss what's next. Subscribe to Net Noodlings with Nathan: