Livewire UI Components - v1.0-beta2
AI Guidelines
Livewire UI Components (livewire-ui-components)
Primary Goal: To guide the creation of reusable, performant, and accessible Livewire components.
Core Principles for the AI:
Reusability: Components should be designed to be self-contained and easily reusable throughout the application.
Performance: Prioritize performance by using Livewire's optimization features, such as wire:model.defer and lazy loading.
Interactivity: Use Alpine.js for client-side interactions that do not require a server round-trip.
Specific Instructions for the AI:
-
Loading States: When generating Livewire components, include loading states using
wire:loadingto provide visual feedback to the user during asynchronous operations. -
Form Input Optimization: For all form inputs, use
wire:model.deferto batch updates and reduce the number of server requests. -
Client-Side Interactions: For complex client-side interactions, such as a dropdown menu, generate Alpine.js code within the Blade view and use the
$wireobject to communicate with the Livewire component. -
Accessibility: Ensure that all interactive elements within Livewire components are fully accessible, with proper focus management and ARIA attributes.