Skip to main content
skill CX Codex

alpine-js — Claude Code skill: what it does, how to install

Guidelines for building reactive Alpine.js interfaces with minimal JavaScript. Helps generate UI components paired with Tailwind CSS, Livewire, and Ghost CMS.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Mindrally/skills --skill alpine-js -a claude-code
Open on GitHub

What alpine-js does

This skill guides AI coding assistants to produce clean, declarative Alpine.js markup. It details standard directives like x-data, x-model, x-show, and x-init. The instructions push complex inline code into Alpine.data() components and keep shared application state inside Alpine.store().

Integration recipes cover styling and backend frameworks. For styling, the prompt pairs x-transition and dynamic classes with Tailwind CSS utility classes. When working with Laravel and Livewire, it instructs the agent to handle client interactions locally and bind data via @entangle, leaving network requests to the server.

For rendering performance, the guidelines explicitly favour x-show over x-if where possible. Complex or heavy components require lazy loading and focus management with standard ARIA attributes.

What it helps with

  • build accessible dropdowns with Tailwind transitions
  • sync frontend state with Laravel Livewire using @entangle
  • extract heavy inline logic into modular Alpine.data() stores
  • validate forms dynamically without external JS bundles

Example prompts for the agent

  • Create an Alpine.js dropdown menu with Tailwind CSS transitions and click-outside dismissal
  • Implement form validation for an email field using x-model in Alpine.js
  • Connect an Alpine.js interactive toggle to a Livewire property via @entangle

How to install alpine-js

1Skills CLI (Vercel)

npx skills add Mindrally/skills --skill alpine-js -a claude-code

2Manually: put the files in place

~/.claude/skills/alpine-js/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/alpine-js/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about alpine-js

How to install alpine-js in Claude Code?

Run npx skills add Mindrally/skills --skill alpine-js -a claude-code. The file will be placed into ~/.claude/skills/alpine-js/SKILL.md.

What does the alpine-js skill do?

It provides architectural rules and directive patterns for Alpine.js development. The agent learns how to structure lightweight reactive interfaces alongside Tailwind CSS and backend stacks.

Why does the guide prefer x-show over x-if?

The skill recommends x-show over x-if to avoid frequent DOM insertion and removal, keeping component toggles faster.

Source text

SKILL.md · Apache-2.0
---
name: alpine-js
description: Alpine.js development guidelines for lightweight reactive interactions with Tailwind CSS and various backend frameworks.
metadata:
  maintainer: Mindrally
  source: https://github.com/Mindrally/skills
---

# 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
```html
<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
```html
<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
```html
<form x-data="{ email: '', isValid: false }" @submit.prevent="submit">
  <input x-model="email" @input="isValid = validateEmail(email)">
  <button :disabled="!isValid">Submit</button>
</form>
```

© Mindrally · Apache-2.0 · Mindrally/skills

Similar skills

Everything for Frontend and UI →

From the same set214

lua Gives the agent a rulebook for Lua: tables, metatables, error handling, game loops and memory. Useful when your project is Lua or Love2D. CX Codex +1 1,300installs tauri-development The skill provides guidelines for building desktop applications with Tauri. It sets coding standards across Rust and TypeScript. CX Codex +1 1,300installs nextjs-typescript-tailwindcss-supabase A skill that steers your agent toward Next.js 14, TypeScript, TailwindCSS and Supabase: server components, error handling, readable code. CX Codex +1 1,300installs electron-development A skill that gives the agent rules for building Electron desktop apps: process separation, IPC, window security. CX Codex +1 1,300installs zod-schema-validation Guides agents on writing Zod schemas, inferring TypeScript types, and validating boundaries in APIs and UI forms. Keeps validation consistent across the codebase. CX Codex +1 1,200installs kafka-development A skill that hands your agent Kafka best practices: topics, partitions, producer and consumer settings, Schema Registry. Useful when you build event-driven code. CX Codex +1 1,200installs bootstrap Tells the agent how to build interfaces with Bootstrap: grid, components, utilities, form validation. Useful when you want no custom CSS. CX Codex +1 1,200installs technical-writing Enforces strict technical writing rules for developer tutorials and documentation. It eliminates cliches and bullet lists to produce deep, practical implementation guides. CX Codex +1 1,200installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor