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