# Alpine.js Documentation - Directives Alpine directives are attributes that you can add to HTML elements to give them special behavior. ## [x-for](/directives/for) Alpine's `x-for` directive allows you to create DOM elements by iterating through a list. Here's a simple example of using it to create a list of colors based on an array. ``` ``` You may also pass objects to `x-for`. ``` ``` There are two rules worth noting about `x-for`: > `x-for` MUST be declared on a `