Skip to content
SortableAPI Reference

Public API Reference

comins-sortable@0.1.6

This reference inventories the package entry points and their public values and types. The feature guides explain behavior and provide complete examples. If an export is not listed here, treat it as internal implementation.

The root entry is the Vanilla JavaScript adapter.

  • createSortable: creates one Vanilla sortable instance and its DOM transaction boundary.
  • Sortable: the returned instance, including area registration, refresh, cancellation, and idempotent destruction.
  • VanillaSortableOptions: root creation options.
  • VanillaSortableAreaOptions: initial area options.
  • VanillaSortableAreaPatch: supported area updates.

See Vanilla JavaScript Adapter.

Core contains framework-neutral operations, lifecycle ownership, errors, and the headless Tree model.

  • SortableError: stable public error with a SortableErrorCode code.
  • reorder: returns an immutable same-area order.
  • transfer: returns immutable source and destination orders.
  • buildCopyChange: prepares a typed copy change without removing the source.
  • createSortableScope: creates an instance-local sortable lifecycle scope.
  • createSortableTree: maps an immutable tree to sortable areas and folds area changes back into the tree.
  • Lifecycle and error types: SortableErrorCode, AfterDragReason, AfterDragResult, DragContext, PointerSnapshot, InsertDragAreaEvent.
  • Identity and location types: ItemKey, SortableId, SortableLocation, SortableParentLocation, SortableOrder.
  • Scope and area types: SortableScope, SortableScopeOptions, SortableAreaOptions, SortableAreaPatch, SortableAreaUpdate.
  • Group and transfer types: SortableGroup, SortableGroupOptions, SortableTransferMode, CopyItem, CopyItemContext.
  • Change types: SortableChange, SortableMoveChange, SortableReorderChange, SortableTransferChange, SortableCopyChange, FrameworkSortableChange. Multi-drag changes also expose itemIds; swap changes use SortableSwapChange and swapItemId.
  • Presentation types: SortableDirection, SortableAnimation, SortableAnimationOptions, SortablePlaceholderOptions, SortablePlaceholderPreset.
  • Tree types: SortableTree, SortableTreeArea, SortableTreeOptions.

See Core Concepts, Reorder and Transfer, Copy and Clone, Nested Lists and Tree, and Lifecycle and Errors. Advanced selection, thresholds, grid collision, and swap behavior are covered in Advanced Sorting.

  • SortableRoot: owns a shared controlled React scope.
  • SortableArea: registers one controlled React area.
  • SortableRootProps: root lifecycle and change props.
  • SortableAreaProps: area data, identity, rendering, and behavior props.

See React Adapter.

  • SortableRoot: owns a shared controlled Vue scope.
  • SortableArea: registers one controlled Vue area.
  • VueSortableRootComponent, VueSortableRootProps, VueSortableRootSlots, and VueSortableRootOptions: typed root component contracts.
  • VueSortableAreaComponent, VueSortableAreaProps, and VueSortableAreaSlots: typed area component contracts.

See Vue Adapter.

  • createSortableScope: creates a shared scope for multiple Svelte actions.
  • sortable: the Svelte action.
  • SvelteActionReturn: the action update and destroy contract.
  • SvelteSortableOptions: one action’s area and lifecycle options.
  • SvelteSortableScope, SvelteSortableScopeOptions: shared scope contracts.

See Svelte Adapter.

Import this entry to enable the public base styles and optional placeholder presets. It is the only declared side-effect entry. See Placeholder Styling.

All entry points are ESM and target ES2020. React, React DOM, Vue, and Svelte are optional peer dependencies; the package has zero runtime dependencies. The browser evidence and certification boundary are maintained in the repository README.


Runnable example · Source guide for this version