interface Options {
    animation?: number;
    bubbleScroll?: boolean;
    chosenClass?: string;
    dataIdAttr?: string;
    delay?: number;
    delayOnTouchOnly?: boolean;
    direction?: ((evt, target, dragEl) => Direction) | Direction;
    disabled?: boolean;
    dragClass?: string;
    draggable?: string;
    dragoverBubble?: boolean;
    dropBubble?: boolean;
    easing?: string;
    emptyInsertThreshold?: number;
    fallbackClass?: string;
    fallbackOffset?: {
        x: number;
        y: number;
    };
    fallbackOnBody?: boolean;
    fallbackTolerance?: number;
    filter?: string | ((this, event, target, sortable) => boolean);
    forceFallback?: boolean;
    ghostClass?: string;
    group?: string | GroupOptions;
    handle?: string;
    ignore?: string;
    invertSwap?: boolean;
    invertedSwapThreshold?: number;
    multiDrag?: boolean;
    multiDragKey?: null;
    onAdd?: ((event) => void);
    onChange?: ((evt) => void);
    onChoose?: ((event) => void);
    onClone?: ((event) => void);
    onDeselect?: ((event) => void);
    onEnd?: ((event) => void);
    onFilter?: ((event) => void);
    onMove?: ((evt, originalEvent) => boolean | void | 1 | -1);
    onRemove?: ((event) => void);
    onSelect?: ((event) => void);
    onSort?: ((event) => void);
    onSpill?: ((evt) => void);
    onStart?: ((event) => void);
    onUnchoose?: ((event) => void);
    onUpdate?: ((event) => void);
    preventOnFilter?: boolean;
    removeCloneOnHide?: boolean;
    removeOnSpill?: boolean;
    revertOnSpill?: boolean;
    scroll?: boolean | HTMLElement;
    scrollFn?: ((this, offsetX, offsetY, originalEvent, touchEvt, hoverTargetEl) => void | "continue");
    scrollSensitivity?: number;
    scrollSpeed?: number;
    selectedClass?: string;
    setData?: ((dataTransfer, draggedElement) => void);
    sort?: boolean;
    store?: {
        get: ((sortable) => string[]);
        set: ((sortable) => void);
    };
    swap?: boolean;
    swapClass?: string;
    swapThreshold?: number;
    touchStartThreshold?: number;
}

Hierarchy

  • SortableOptions
  • AutoScrollOptions
  • MultiDragOptions
  • OnSpillOptions
  • SwapOptions
    • Options

Properties

animation?: number

ms, animation speed moving items when sorting, 0 — without animation

bubbleScroll?: boolean

apply autoscroll to all parent elements, allowing for easier movement.

chosenClass?: string

Class name for the chosen item

dataIdAttr?: string
delay?: number

time in milliseconds to define when the sorting should start

delayOnTouchOnly?: boolean

Only delay if user is using touch

direction?: ((evt, target, dragEl) => Direction) | Direction

Direction of Sortable (will be detected automatically if not given)

Type declaration

disabled?: boolean

Disables the sortable if set to true.

dragClass?: string

Class name for the dragging item

draggable?: string

Specifies which items inside the element should be draggable

dragoverBubble?: boolean
dropBubble?: boolean
easing?: string

Easing for animation. Defaults to null.

See https://easings.net/ for examples.

For other possible values, see https://www.w3schools.com/cssref/css3_pr_animation-timing-function.asp

Example

// CSS functions
| 'steps(int, start | end)'
| 'cubic-bezier(n, n, n, n)'

// CSS values
| 'linear'
| 'ease'
| 'ease-in'
| 'ease-out'
| 'ease-in-out'
| 'step-start'
| 'step-end'
| 'initial'
| 'inherit'
emptyInsertThreshold?: number

distance mouse must be from empty sortable to insert drag element into it

fallbackClass?: string

Class name for the cloned DOM Element when using forceFallback

fallbackOffset?: {
    x: number;
    y: number;
}

Type declaration

  • x: number
  • y: number
fallbackOnBody?: boolean

Appends the cloned DOM Element into the Document's Body

fallbackTolerance?: number

Specify in pixels how far the mouse should move before it's considered as a drag.

filter?: string | ((this, event, target, sortable) => boolean)

Selectors that do not lead to dragging (String or Function)

Type declaration

    • (this, event, target, sortable): boolean
    • Parameters

      Returns boolean

forceFallback?: boolean

ignore the HTML5 DnD behaviour and force the fallback to kick in

ghostClass?: string

Class name for the drop placeholder

group?: string | GroupOptions

To drag elements from one list into another, both lists must have the same group value. You can also define whether lists can give away, give and keep a copy (clone), and receive elements.

handle?: string

Drag handle selector within list items

ignore?: string
invertSwap?: boolean

Will always use inverted swap zone if set to true

invertedSwapThreshold?: number

Threshold of the inverted swap zone (will be set to swapThreshold value by default)

multiDrag?: boolean

Enable the plugin

multiDragKey?: null

Key that must be down for items to be selected

onAdd?: ((event) => void)

Type declaration

    • (event): void
    • Element is dropped into the list from another list

      Parameters

      Returns void

onChange?: ((evt) => void)

Type declaration

    • (evt): void
    • Called when dragging element changes position

      Parameters

      Returns void

onChoose?: ((event) => void)

Type declaration

    • (event): void
    • Element is chosen

      Parameters

      Returns void

onClone?: ((event) => void)

Type declaration

    • (event): void
    • Created a clone of an element

      Parameters

      Returns void

onDeselect?: ((event) => void)

Type declaration

    • (event): void
    • Called when an item is deselected

      Parameters

      Returns void

onEnd?: ((event) => void)

Type declaration

    • (event): void
    • Element dragging ended

      Parameters

      Returns void

onFilter?: ((event) => void)

Type declaration

    • (event): void
    • Attempt to drag a filtered element

      Parameters

      Returns void

onMove?: ((evt, originalEvent) => boolean | void | 1 | -1)

Type declaration

    • (evt, originalEvent): boolean | void | 1 | -1
    • Event when you move an item in the list or between lists

      Parameters

      Returns boolean | void | 1 | -1

onRemove?: ((event) => void)

Type declaration

    • (event): void
    • Element is removed from the list into another list

      Parameters

      Returns void

onSelect?: ((event) => void)

Type declaration

    • (event): void
    • Called when an item is selected

      Parameters

      Returns void

onSort?: ((event) => void)

Type declaration

    • (event): void
    • Called by any change to the list (add / update / remove)

      Parameters

      Returns void

onSpill?: ((evt) => void)

Type declaration

    • (evt): void
    • Called when either revertOnSpill or RemoveOnSpill plugins are enabled.

      Parameters

      Returns void

onStart?: ((event) => void)

Type declaration

    • (event): void
    • Element dragging started

      Parameters

      Returns void

onUnchoose?: ((event) => void)

Type declaration

    • (event): void
    • Element is unchosen

      Parameters

      Returns void

onUpdate?: ((event) => void)

Type declaration

    • (event): void
    • Changed sorting within list

      Parameters

      Returns void

preventOnFilter?: boolean

Call event.preventDefault() when triggered filter

removeCloneOnHide?: boolean

Remove the clone element when it is not showing, rather than just hiding it

removeOnSpill?: boolean

This plugin, when enabled, will cause the dragged item to be removed from the DOM if it is spilled (ie. it is dropped outside of a valid Sortable drop target)

revertOnSpill?: boolean

This plugin, when enabled, will cause the dragged item to be reverted to it's original position if it is spilled (ie. it is dropped outside of a valid Sortable drop target)

scroll?: boolean | HTMLElement

Enable the plugin. Can be HTMLElement.

scrollFn?: ((this, offsetX, offsetY, originalEvent, touchEvt, hoverTargetEl) => void | "continue")

Type declaration

    • (this, offsetX, offsetY, originalEvent, touchEvt, hoverTargetEl): void | "continue"
    • if you have custom scrollbar scrollFn may be used for autoscrolling.

      Parameters

      • this: Sortable
      • offsetX: number
      • offsetY: number
      • originalEvent: Event
      • touchEvt: TouchEvent
      • hoverTargetEl: HTMLElement

      Returns void | "continue"

scrollSensitivity?: number

px, how near the mouse must be to an edge to start scrolling.

scrollSpeed?: number

px, speed of the scrolling.`

selectedClass?: string

Class name for selected item

setData?: ((dataTransfer, draggedElement) => void)

Type declaration

    • (dataTransfer, draggedElement): void
    • Parameters

      • dataTransfer: DataTransfer
      • draggedElement: HTMLElement

      Returns void

sort?: boolean

sorting inside list

store?: {
    get: ((sortable) => string[]);
    set: ((sortable) => void);
}

Type declaration

  • get: ((sortable) => string[])
      • (sortable): string[]
      • Parameters

        Returns string[]

  • set: ((sortable) => void)
      • (sortable): void
      • Parameters

        Returns void

swap?: boolean

Enable swap mode

swapClass?: string

Class name for swap item (if swap mode is enabled)

swapThreshold?: number

Threshold of the swap zone. Defaults to 1

touchStartThreshold?: number

How many pixels the point should move before cancelling a delayed drag event

Generated using TypeDoc