Files
email-organizer/offline-docs/alpinejs/directives/ignore.md
2025-08-13 09:33:19 -07:00

752 B

Alpine.js Documentation - Directives

Alpine directives are attributes that you can add to HTML elements to give them special behavior.

x-ignore

By default, Alpine will crawl and initialize the entire DOM tree of an element containing x-init or x-data.

If for some reason, you don't want Alpine to touch a specific section of your HTML, you can prevent it from doing so using x-ignore.

<div x-data="{ label: 'From Alpine' }">


n<div x-ignore>


n<span x-text="label"></span>


n</div>


n</div>

In the above example, the <span> tag will not contain "From Alpine" because we told Alpine to ignore the contents of the div completely.

Code highlighting provided by Torchlight