| 1 | --- |
| 2 | title: "htmx:after:settle" |
| 3 | description: "After the settle phase completes" |
| 4 | --- |
| 5 | |
| 6 | The `htmx:after:settle` event fires after htmx finishes the settle phase, including any CSS transitions. |
| 7 | |
| 8 | ## When It Fires |
| 9 | |
| 10 | After all settle tasks (CSS transitions, attribute cleanup) have completed for newly swapped content. |
| 11 | |
| 12 | ## Event Detail |
| 13 | |
| 14 | - `task` - The swap task that was settled |
| 15 | - `newContent` - Array of settled elements |
| 16 | - `settleTasks` - Array of settle tasks that ran |
| 17 | |
| 18 | ## Example |
| 19 | |
| 20 | ```javascript |
| 21 | htmx.on('htmx:after:settle', (evt) => { |
| 22 | console.log('Settle complete for', evt.detail.newContent.length, 'element(s)'); |
| 23 | // Safe to interact with fully-settled DOM |
| 24 | }); |
| 25 | ``` |
| 26 | |
| 27 | The DOM is fully stable at this point — all transitions have run and temporary attributes have been cleaned up. |