Table of Contents

Method Sortable

Namespace
Velvet
Assembly
Velvet.Docs.dll

Sortable(string, object?, bool, DragMovement, DragActivation?, DndSortingStrategy?, string?, string?, string?, string?, string?, FiberElementProps?, StyleOverrides?, Func<VisualElement, Action>?, VNode?[]?, string?, string?, string?, IReadOnlyDictionary<string, string>?, IReadOnlyDictionary<string, string>?, FiberEventBinding[]?)

Sortable item, dnd-kit's useSortable node: one element that is both a draggable and a droppable under id, which the nearest SortableContext(IReadOnlyList<string>, DndSortingStrategy?, string?, VNode?[]?, string?) moves aside while a drag sorts its items. The reorder itself stays app logic in onDragEnd, as with dnd-kit.

public static ComponentNode Sortable(string id, object? sortableData = null, bool disabled = false, DragMovement movement = DragMovement.Translate, DragActivation? activation = null, DndSortingStrategy? strategy = null, string? whileDraggingClass = null, string? whileOverClass = null, string? className = null, string? key = null, string? name = null, FiberElementProps? props = null, StyleOverrides? styles = null, Func<VisualElement, Action>? refCallback = null, VNode?[]? children = null, string? whileHoverClass = null, string? whileTapClass = null, string? whileFocusClass = null, IReadOnlyDictionary<string, string>? data = null, IReadOnlyDictionary<string, string>? aria = null, FiberEventBinding[]? events = null)

Parameters

id string

The item's id, as it appears in the context's items.

sortableData object

Arbitrary payload carried into the callbacks.

disabled bool

A disabled item neither drags nor collides.

movement DragMovement

Whether the item follows the drag itself; None for the V.DragOverlay pattern, where the item instead moves to the slot it would drop into.

activation DragActivation

This item's activation constraint, over the scope's.

strategy DndSortingStrategy

This item's sorting strategy, over the context's.

whileDraggingClass string

Classes applied while this item is dragged.

whileOverClass string

Classes applied while the drag is over this item.

className string
key string
name string
props FiberElementProps
styles StyleOverrides
refCallback Func<VisualElement, Action>
children VNode[]
whileHoverClass string
whileTapClass string
whileFocusClass string
data IReadOnlyDictionary<string, string>
aria IReadOnlyDictionary<string, string>
events FiberEventBinding[]

Event bindings applied to the element (Documentation~/react-migration.md owns the rule). The array is read and never written.

Returns

ComponentNode

The created ComponentNode.