# Alpine.js Documentation - Directives Alpine directives are attributes that you can add to HTML elements to give them special behavior. ## [x-if](/directives/if) `x-if` is used for toggling elements on the page, similarly to `x-show`, however it completely adds and removes the element it's applied to rather than just changing its CSS display property to "none". Because of this difference in behavior, `x-if` should not be applied directly to the element, but instead to a `