sortable

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 2 Imported by: 0

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

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 New

func New() *Sortable

New creates a new Sortable 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) Init

func (s *Sortable) Init(ctx context.Context, registry *plugin.Registry) error

Init initializes the sortable plugin.

func (*Sortable) Magics

func (s *Sortable) Magics() []plugin.AlpineMagic

Magics returns custom magic properties.

func (*Sortable) Scripts

func (s *Sortable) Scripts() []plugin.Script

Scripts returns SortableJS library and directive.

func (*Sortable) Shutdown

func (s *Sortable) Shutdown(ctx context.Context) error

Shutdown cleanly shuts down the plugin.

func (*Sortable) Stores

func (s *Sortable) Stores() []plugin.AlpineStore

Stores returns Alpine stores.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL