Interface DragProps

Props of the useDrag hook.

interface DragProps {
    isDisabled?: boolean;
    onDrag?: ((info: DragInfo) => void);
    onDragChange?: ((isDragged: boolean) => void);
    onDragEnd?: ((info: DragInfo) => void);
    onDragStart?: ((info: DragInfo) => void);
}

Hierarchy (view full)

Properties

isDisabled?: boolean

If true drag listeners are disabled.

false
onDrag?: ((info: DragInfo) => void)

A handler that is called when a user is actively dragging an element.

Type declaration

    • (info): void
    • Parameters

      • info: DragInfo

        An info about the current drag frame.

      Returns void

onDragChange?: ((isDragged: boolean) => void)

A handler that is called when the drag state changes.

Type declaration

    • (isDragged): void
    • Parameters

      • isDragged: boolean

        true if an element is dragged.

      Returns void

onDragEnd?: ((info: DragInfo) => void)

A handler that is called when a user stops dragging an element.

Type declaration

    • (info): void
    • Parameters

      • info: DragInfo

        An info about the current drag frame.

      Returns void

onDragStart?: ((info: DragInfo) => void)

A handler that is called when a user starts to drag an element.

Type declaration

    • (info): void
    • Parameters

      • info: DragInfo

        An info about the current drag frame.

      Returns void