Table of Contents

Method Draggable

Namespace
Velvet
Assembly
Velvet.Docs.dll

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

public static ElementNode Draggable(string id, object? dragData = null, bool disabled = false, DragMovement movement = DragMovement.Translate, DragActivation? activation = null, string? whileDraggingClass = 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)

Parameters

id string

Identity reported to the scope callbacks. An element that is both draggable and droppable under one id never collides with itself.

dragData object

Arbitrary payload carried into the callbacks.

disabled bool

A disabled draggable never arms.

movement DragMovement

Translate (default) writes the pointer delta as an inline translate during the drag; None leaves the source in place (the V.DragOverlay ghost pattern).

activation DragActivation

Per-draggable activation constraint; wins over the scope's.

whileDraggingClass string

Classes applied while this element's drag is active — the zero-re-render isDragging channel.

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>

Returns

ElementNode

The created ElementNode.

Exceptions

ArgumentOutOfRangeException

movement names no member of DragMovement.