Rendering lists in Alpine.js

displaying the items of an array as a list
2025-09-28 21:33
// updated 2025-11-25 09:10

Provided we have an array encoded in JSON we can easily display its items in the form of a list with a very streamlined x-for syntax:

Note that we also use the shorthand syntax for x-bind:key (:key) so that each list item has a unique identifier!

⬅️ older (posts)
🚸 On re-learning things
newer (posts) ➡️
2025-09 🪶