Reusable Alpine Components by Ryan Chandler
I’ve been more Alpine lately. Ryan has written a lot of good stuff on Alpine, but his reusable components post is what really got me kickstarted.
You should be careful to not abstract too early. If you are finding it difficult to manage your Alpine component from the
x-dataattribute, this one is definitely for you.
The way this article builds up was very helpful: only use the level of abstraction you need:
- No abstractions
- Extract to a component function
- Mix in other data