Interface HeadlessTrackHandleProps

Props of the useTrackHandle hook.

interface HeadlessTrackHandleProps {
    getTrackRect: (() => undefined | DOMRect);
    handleMargin?: number;
    isDisabled?: boolean;
    onDrag?: ((info: DragInfo) => void);
    onDragChange?: ((isDragged: boolean) => void);
    onDragEnd?: ((info: DragInfo) => void);
    onDragStart?: ((info: DragInfo) => void);
    onPercentageChange?: ((percentage: number) => void);
    orientation?: "vertical" | "horizontal";
}

Hierarchy (view full)

Properties

getTrackRect: (() => undefined | DOMRect)

Returns a bounding rect of a track.

handleMargin?: number

Minimum distance between track bounds and handle bounds in the orientation direction.

0
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

onPercentageChange?: ((percentage: number) => void)

A handler that is called when the handle is dragged along the track.

Type declaration

    • (percentage): void
    • Parameters

      • percentage: number

        A percentage at which a track is positioned.

      Returns void

orientation?: "vertical" | "horizontal"

The orientations of a track along which a handle is dragged.

"horizontal"