Access the Global Store: $store

Learn to access global AlpineJS stores with the $store magic property.

AlpineJS stores

Sometimes, our components may need data in order for them to work well. We can define this data using AlpineJS stores. An AlpineJS store is data defined in an Alpine.store global method. Even though AlpineJS stores are not persistent, we can use them to provide data to our components. This data can then be accessed using the $store magic property.

Get hands-on with 1400+ tech skills courses.