s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All UI components

Svelte · Sortable

Sortable

No summary has been written for Sortable. Everything below is generated from the declaration shipped in 0.57.40 and describes the real contract.

Public export

typescript
import { Sortable } from '@happyvertical/smrt-svelte/sortable';
Import path
@happyvertical/smrt-svelte/sortable
Props
9
Props described
9 of 9
Bindable state
0
Callback events
2
Verified release
0.57.40

Props

NameTypeRequiredDescription
containersreadonly Container[]YesContainers in display order. The owner is authoritative.
itemsreadonly Item[]YesItems; order within a container is their order here.
labelstringNoAccessible name for the whole list.
reorderContainersbooleanNoLet the user reorder the (non-`fixed`) containers too.
allowSameContainerReorderbooleanNoWhether items may be reordered within their container (default true); `false` only allows moving them between containers.
itemSnippet<[SortableItemSnippetProps<Item, Container>]>YesContent beside each item's move handle.
containerHeaderSnippet<[SortableContainerHeaderSnippetProps<Container>]>NoContent in a container's header, beside its move handle.
onmove(move: SortableItemMove<Item, Container>) => void | Promise<void>NoReceives a typed item move. May persist asynchronously; a rejection restores the presentation and is announced. Omit to make items read-only.
oncontainermove(move: SortableContainerMove<Container>) => void | Promise<void>NoReceives a container move (requires `reorderContainers`).

Bindable state

This component has no bindable public state.

Callback events

  • onmove(move: SortableItemMove<Item, Container>) => void | Promise<void>
  • oncontainermove(move: SortableContainerMove<Container>) => void | Promise<void>

Examples and explanation