Skip to content

Alpine.js Handbook

Sometimes you just want a dropdown, an accessible modal, a live filter, or a shopping cart drawer without spinning up a build pipeline and hydrating an entire page in React.

This book teaches you Alpine.js 3 through real UI patterns you can drop straight into Astro, Laravel, Rails, Django, or htmx apps, while keeping your markup clean, accessible, and easy to test.

Table of contents (29 chapters)
  1. How Alpine.js reactivity works
  2. Core Alpine.js 3 directives at a glance
  3. Reusable components with Alpine.data() and global Alpine.store()
  4. Part 1: Complete Alpine.js Guide
  5. The Alpine.js Guide
  6. Why I use Alpine.js
  7. How to implement file upload with drag and drop with Alpine
  8. htmx + Alpine template tag
  9. Alpine.js Directives Deep Dive: x-show vs x-if and Event Modifiers
  10. Magic Properties ($refs, $watch, $dispatch, $nextTick, $store)
  11. Pairing Alpine.js with htmx (Clean Ownership Boundaries)
  12. Accessible Tabs, Copy-to-Clipboard, and Multi-Step Form Wizard
  13. Testing Alpine.js Component Logic
  14. Part 3: Production Alpine.js UI Recipes and CSP Safety
  15. Accessible modal with keyboard escape and focus safety
  16. Official Alpine.js plugins and the CSP-safe build
  17. Reactivity Under the Hood: Proxies, x-effect, and x-ignore
  18. Mastering x-model Across Every Form Control
  19. Smooth Transitions and Reduced Motion
  20. Real-World Alpine.js 3 Component Cookbook
  21. Async Data Fetching, Race Conditions, and AbortController
  22. Building an Accessible Combobox and Autocomplete
  23. Shopping Cart with Alpine.store(), Computed Totals, and @alpinejs/persist
  24. Working with Official Plugins: Mask, Anchor, Intersect, and Collapse
  25. Integrating Alpine.js with Server-Rendered Frameworks
  26. Debugging Alpine.js Apps and Performance Tuning
  27. Common Alpine.js Pitfalls and How to Avoid Them
  28. When to Choose Alpine.js vs React or Vue
  29. Alpine.js Production Checklist

Get the Alpine.js Handbook for free: subscribe to my newsletter and I'll send it your way, together with all my other free programming ebooks.

Want the whole collection? See all my free ebooks.

By subscribing you agree to receive my newsletter (new tutorials, book releases, and courses). You can unsubscribe anytime from the link at the bottom of every email. Your email is the only data collected, stored securely in the EU, and never shared.