diff --git a/Alpine.js DOCS.md b/Alpine.js DOCS.md index 659b115..e38b372 100644 --- a/Alpine.js DOCS.md +++ b/Alpine.js DOCS.md @@ -703,4 +703,119 @@ Alpine also offers a hook that you can use to execute code AFTER it's done initi document.addEventListener('alpine:initialized', () => { // }) -``` \ No newline at end of file +``` + +----- +# Directives +# x-data + +Everything in Alpine starts with the `x-data` directive. + +`x-data` defines a chunk of HTML as an Alpine component and provides the reactive data for that component to reference. + +Here's an example of a contrived dropdown component: + +```html +