← All extensions

Alpine.js Snippets

v0.0.1 · by Assem Alwaseai · added 3 November 2026

Comprehensive Alpine.js v3+ code snippets for faster development

Snippets

How to install

With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.

You can also open the Extensions panel in the app and search for Alpine.js Snippets. The extension's id is alpinejs-snippets.

Don't have Forge Super yet? Download it here.

README

From the extension's repository, written by its authors and not by Mentenaz. See the source.

Alpine.js Snippets for Zed

Comprehensive Alpine.js v3+ code snippets for faster development in Zed editor.

Features

  • 🚀 30+ Alpine.js snippets covering all major directives
  • 💡 IntelliSense-friendly with descriptive names and tab stops
  • 🎯 Component patterns for common use cases (modals, forms, toggles)
  • 📝 Complete examples with proper Alpine.js syntax
  • ⚡ Optimized for productivity with logical tab order

Available Snippets

Core Directives

PrefixDescription
x-dataComponent data initialization
x-data-objData object with init method
x-initElement initialization hook
x-showConditional element visibility
x-bindAttribute binding
x-onEvent handling
x-textText content binding
x-htmlHTML content binding
x-modelTwo-way data binding

Conditional Rendering

PrefixDescription
x-ifConditional template rendering
x-forList rendering
x-for-keyList rendering with key

Event Shortcuts

PrefixDescription
@clickClick event handler
@submitForm submit handler
@keydownKeydown event handler

Styling & Classes

PrefixDescription
:classConditional CSS classes
:styleInline style binding

Transitions

PrefixDescription
x-transitionBasic transition
x-transition-enterEnter transition classes
x-transition-leaveLeave transition classes

Component Patterns

PrefixDescription
alpine-compBasic component structure
alpine-modalModal component
alpine-toggleToggle component
alpine-formForm with validation

Utilities

PrefixDescription
x-cloakHide until initialized
x-ignoreSkip Alpine initialization
x-refElement reference
x-teleportMove element in DOM
alpine-cdnAlpine.js CDN script
alpine-storeGlobal store definition

Installation

  1. Clone or download this extension
  2. Place in your Zed extensions directory
  3. Restart Zed
  4. Start typing Alpine.js snippets in HTML files!

Usage

Simply start typing any snippet prefix in an HTML file and press Tab to expand. Use Tab to navigate through placeholder values.

Example

Type alpine-comp and press Tab:

<div x-data="{
  property: value,
  
  init() {
    // initialization code
  },
  
  method() {
    // method body
  }
}">
  <!-- component content -->
</div>

Contributing

Found a bug or want to add more snippets? Contributions are welcome!

Resources

License

MIT License - see LICENSE file for details.