Documentation
¶
Overview ¶
Package sortable provides drag-and-drop list reordering using SortableJS.
The sortable plugin adds an x-sortable directive that makes lists draggable with smooth animations and callbacks for server synchronization.
Basic Usage ¶
registry := plugin.NewRegistry() registry.Use(sortable.New())
Features ¶
- Drag-and-drop list reordering
- Handle selector configuration
- Animation options
- Callback hooks (onStart, onEnd, onUpdate)
- Server sync via HTMX
Index ¶
- type Sortable
- func (s *Sortable) AlpineComponents() []plugin.AlpineComponent
- func (s *Sortable) Directives() []plugin.AlpineDirective
- func (s *Sortable) Init(ctx context.Context, registry *plugin.Registry) error
- func (s *Sortable) Magics() []plugin.AlpineMagic
- func (s *Sortable) Scripts() []plugin.Script
- func (s *Sortable) Shutdown(ctx context.Context) error
- func (s *Sortable) Stores() []plugin.AlpineStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sortable ¶
type Sortable struct {
*plugin.PluginBase
// contains filtered or unexported fields
}
Sortable plugin implements Alpine plugin.
func (*Sortable) AlpineComponents ¶
func (s *Sortable) AlpineComponents() []plugin.AlpineComponent
AlpineComponents returns Alpine.data components.
func (*Sortable) Directives ¶
func (s *Sortable) Directives() []plugin.AlpineDirective
Directives returns the x-sortable directive.
func (*Sortable) Magics ¶
func (s *Sortable) Magics() []plugin.AlpineMagic
Magics returns custom magic properties.
func (*Sortable) Stores ¶
func (s *Sortable) Stores() []plugin.AlpineStore
Stores returns Alpine stores.
Click to show internal directories.
Click to hide internal directories.