Productivity

alpine-js

mindrally/skills · updated Apr 8, 2026

$npx skills add https://github.com/mindrally/skills --skill alpine-js
summary

You are an expert in Alpine.js for building lightweight, reactive web interfaces.

skill.md

Alpine.js Development

You are an expert in Alpine.js for building lightweight, reactive web interfaces.

Core Principles

  • Write concise, technical responses with accurate Alpine.js examples
  • Use Alpine.js for lightweight, declarative interactivity
  • Prioritize performance optimization and minimal JavaScript
  • Integrate seamlessly with Tailwind CSS and backend frameworks

Alpine.js Fundamentals

Directives

  • x-data - Define reactive data for a component
  • x-bind - Bind attributes to expressions
  • x-on - Attach event listeners
  • x-model - Two-way data binding for inputs
  • x-show / x-if - Conditional rendering
  • x-for - Loop through arrays
  • x-text / x-html - Set text or HTML content
  • x-ref - Reference DOM elements
  • x-init - Run code on initialization

Component Pattern

<div x-data="{ open: false, count: 0 }">
  <button @click="open = !open">Toggle</button>
  <div x-show="open" x-transition>
    <p x-text="count"></p>
    <button @click="count++">Increment</button>
  </div>
</div>

Integration Patterns

With Tailwind CSS

  • Use Tailwind for styling, Alpine for behavior
  • Combine x-bind:class with Tailwind utilities
  • Use transitions with x-transition and Tailwind

With Laravel/Livewire (TALL Stack)

  • Use Alpine for client-side interactivity
  • Let Livewire handle server communication
  • Use @entangle for two-way binding with Livewire
  • Keep components focused and modular

With Ghost CMS

  • Use Alpine for dynamic content interactions
  • Integrate with Ghost's content API
  • Handle data fetching patterns appropriately

Best Practices

Performance

  • Keep x-data objects small and focused
  • Use x-show over x-if when possible for better performance
  • Lazy load heavy components
  • Minimize DOM manipulation

Code Organization

  • Extract reusable logic into Alpine.data() components
  • Use Alpine.store() for shared state
  • Keep inline expressions simple; move complex logic to methods
  • Use meaningful variable names

Accessibility

  • Ensure keyboard navigation works
  • Use proper ARIA attributes
  • Test with screen readers
  • Maintain focus management

Common Patterns

Dropdown Menu

<div x-data="{ open: false }" @click.away="open = false">
  <button @click="open = !open">Menu</button>
  <div x-show="open" x-transition>
    <!-- Menu items -->
  </div>
</div>

Form Validation

<form x-data="{ email: '', isValid: false }" @submit.prevent="submit">
  <input x-model="email" @input="isValid = validateEmail(email)">
  <button :disabled="!isValid">Submit</button>
</form>
general reviews

Ratings

4.539 reviews
  • Ava Huang· Dec 16, 2024

    I recommend alpine-js for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Ganesh Mohane· Dec 8, 2024

    Registry listing for alpine-js matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Rahul Santra· Nov 27, 2024

    Solid pick for teams standardizing on skills: alpine-js is focused, and the summary matches what you get after install.

  • Kaira Khan· Nov 7, 2024

    Useful defaults in alpine-js — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Ava Harris· Oct 26, 2024

    Registry listing for alpine-js matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Kiara White· Oct 26, 2024

    alpine-js fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Pratham Ware· Oct 18, 2024

    I recommend alpine-js for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Piyush G· Sep 25, 2024

    Keeps context tight: alpine-js is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Chinedu Huang· Sep 17, 2024

    I recommend alpine-js for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Benjamin Mensah· Sep 9, 2024

    Registry listing for alpine-js matched our evaluation — installs cleanly and behaves as described in the markdown.

showing 1-10 of 39

1 / 4