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
idstringThe item's id, as it appears in the context's items.
sortableDataobjectArbitrary payload carried into the callbacks.
disabledboolA disabled item neither drags nor collides.
movementDragMovementWhether the item follows the drag itself; None for the
V.DragOverlaypattern, where the item instead moves to the slot it would drop into.activationDragActivationThis item's activation constraint, over the scope's.
strategyDndSortingStrategyThis item's sorting strategy, over the context's.
whileDraggingClassstringClasses applied while this item is dragged.
whileOverClassstringClasses applied while the drag is over this item.
classNamestringkeystringnamestringpropsFiberElementPropsstylesStyleOverridesrefCallbackFunc<VisualElement, Action>childrenVNode[]whileHoverClassstringwhileTapClassstringwhileFocusClassstringdataIReadOnlyDictionary<string, string>ariaIReadOnlyDictionary<string, string>eventsFiberEventBinding[]Event bindings applied to the element (
Documentation~/react-migration.mdowns the rule). The array is read and never written.
Returns
- ComponentNode
The created ComponentNode.