Alpine js
Skill VRIL-LABS/skill-jam/skills/ai-ml/skills-main-2/skills-main/alpine-js
Welcome to the skill-jam ☄️🏀
npx -y skills add VRIL-LABS/skill-jam --skill alpine-jsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Alpine.js development guidelines for lightweight reactive interactions with Tailwind CSS and various backend frameworks.
SKILL.md
2.7 KB, 636 tokens by cl100k_base, as published. Nobody here has run it
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 componentx-bind- Bind attributes to expressionsx-on- Attach event listenersx-model- Two-way data binding for inputsx-show/x-if- Conditional renderingx-for- Loop through arraysx-text/x-html- Set text or HTML contentx-ref- Reference DOM elementsx-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:classwith Tailwind utilities - Use transitions with
x-transitionand Tailwind
With Laravel/Livewire (TALL Stack)
- Use Alpine for client-side interactivity
- Let Livewire handle server communication
- Use
@entanglefor 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-dataobjects small and focused - Use
x-showoverx-ifwhen 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>