Declare Our Website Data: x-data

Learn to use the `x-data` attribute to declare data required by the AlpineJS component.

Unlike vanilla JavaScript, most AlpineJS directives and constructs only work in an AlpineJS component. That means we can only access them within a component. An AlpineJS component is a chunk of HTML marked with x-data.

Get hands-on with 1200+ tech skills courses.