Moveable
    Preparing search index...

    Interface MoveableOptions

    interface MoveableOptions {
        ables?: Able<IObject<any>, IObject<any>>[];
        bounds?: BoundType | null;
        checkInput?: boolean;
        checkResizableError?: boolean;
        className?: string;
        clickable?: boolean;
        clipArea?: boolean;
        clipHorizontalGuidelines?: (string | number)[];
        clippable?: boolean | ClippableOptions;
        clipRelative?: boolean;
        clipSnapThreshold?: number;
        clipTargetBounds?: boolean;
        clipVerticalGuidelines?: (string | number)[];
        container?: SVGElement | HTMLElement | null;
        controlPadding?: number;
        cspNonce?: string;
        customClipPath?: string;
        defaultClipPath?: string;
        defaultGroupOrigin?: string;
        defaultGroupRotate?: number;
        displayAroundControls?: boolean;
        dragArea?: boolean;
        dragContainer?: Window | MoveableRefType<HTMLElement>;
        dragFocusedInput?: boolean;
        draggable?: boolean;
        dragTarget?: MoveableRefType<SVGElement | HTMLElement>;
        dragTargetSelf?: boolean;
        dragWithClip?: boolean;
        edge?: boolean | LineDirection[];
        edgeDraggable?: boolean | LineDirection[];
        elementGuidelines?: (
            ElementGuidelineValueOption
            | MoveableRefType<Element>
        )[];
        elementSnapDirections?: boolean | SnapDirections;
        flushSync?: (callback: () => void) => void;
        getScrollPosition?: (
            e: { direction: number[]; scrollContainer: HTMLElement },
        ) => number[];
        groupableProps?: Record<string, any>;
        hideChildMoveableDefaultLines?: boolean;
        hideDefaultLines?: boolean;
        hideThrottleDragRotateLine?: boolean;
        horizontalGuidelines?: (string | number | PosGuideline)[];
        individualGroupable?: boolean;
        individualGroupableProps?: (
            element: SVGElement | HTMLElement | null | undefined,
            index: number,
        ) => void | Record<string, any> | null | undefined;
        innerBounds?: InnerBoundType | null;
        isDisplayGridGuidelines?: boolean;
        isDisplayInnerSnapDigit?: boolean;
        isDisplayShadowRoundControls?: boolean | "horizontal";
        isDisplaySnapDigit?: boolean;
        keepRatio?: boolean;
        keepRatioFinally?: boolean;
        linePadding?: number;
        maxRoundControls?: number[];
        maxSnapElementGapDistance?: number;
        maxSnapElementGuidelineDistance?: number;
        minRoundControls?: number[];
        origin?: boolean;
        originDraggable?: boolean;
        originRelative?: boolean;
        padding?: number | PaddingBox;
        passDragArea?: boolean;
        persistData?: PersistRectData | null;
        pinchable?: boolean | ("rotatable" | "resizable" | "scalable")[];
        pinchOutside?: boolean;
        pinchThreshold?: number;
        preventClickDefault?: boolean;
        preventClickEventOnDrag?: boolean;
        preventDefault?: boolean;
        preventRightClick?: boolean;
        preventWheelClick?: boolean;
        props?: Record<string, any>;
        renderDirections?: boolean | string[];
        resizable?: boolean | ResizableOptions;
        resizeFormat?: (size: number[]) => number[];
        resolveAblesWithRotatable?: Record<string, LineDirection[]> | null;
        rootContainer?: MoveableRefType<HTMLElement>;
        rotatable?: boolean | RotatableOptions;
        rotateAroundControls?: boolean;
        rotationPosition?: RotationPosition | RotationPosition[];
        rotationTarget?:
            | false
            | MoveableRefType<SVGElement | HTMLElement>
            | ArrayFormat<MoveableRefType<SVGElement | HTMLElement>>;
        roundable?: boolean;
        roundClickable?: boolean | "control" | "line";
        roundPadding?: number;
        roundRelative?: boolean;
        scalable?: boolean | ScalableOptions;
        scrollable?: boolean;
        scrollContainer?: MoveableRefType<HTMLElement>;
        scrollOptions?: Partial<DragScrollOptions> | null;
        scrollThreshold?: number;
        scrollThrottleTime?: number;
        snapContainer?: MoveableRefType<SVGElement | HTMLElement>;
        snapDigit?: number;
        snapDirections?: boolean | SnapDirections;
        snapDistFormat?: (
            distance: number,
            type: "horizontal" | "vertical",
        ) => string | number;
        snapGap?: boolean;
        snapGridAll?: boolean;
        snapGridHeight?: number;
        snapGridWidth?: number;
        snapHorizontalThreshold?: number;
        snappable?: boolean | string[];
        snapRenderThreshold?: number;
        snapRotationDegrees?: number[];
        snapRotationThreshold?: number;
        snapThreshold?: number;
        snapVerticalThreshold?: number;
        startDragRotate?: number;
        stopPropagation?: boolean;
        svgOrigin?: string;
        target?: MoveableRefTargetType;
        targetGroups?: MoveableTargetGroupsType;
        throttleDrag?: number;
        throttleDragRotate?: number;
        throttleResize?: number;
        throttleRotate?: number;
        throttleScale?: number;
        transformOrigin?: string | (string | number)[];
        translateZ?: string | number;
        triggerAblesSimultaneously?: boolean;
        useAccuratePosition?: boolean;
        useDefaultGroupRotate?: boolean;
        useMutationObserver?: boolean;
        useResizeObserver?: boolean;
        verticalGuidelines?: (string | number | PosGuideline)[];
        viewContainer?: MoveableRefType<HTMLElement>;
        warpable?: boolean;
        zoom?: number;
    }

    Hierarchy (View Summary)

    Index
    ables? bounds? checkInput? checkResizableError? className? clickable? clipArea? clipHorizontalGuidelines? clippable? clipRelative? clipSnapThreshold? clipTargetBounds? clipVerticalGuidelines? container? controlPadding? cspNonce? customClipPath? defaultClipPath? defaultGroupOrigin? defaultGroupRotate? displayAroundControls? dragArea? dragContainer? dragFocusedInput? draggable? dragTarget? dragTargetSelf? dragWithClip? edge? edgeDraggable? elementGuidelines? elementSnapDirections? flushSync? getScrollPosition? groupableProps? hideChildMoveableDefaultLines? hideDefaultLines? hideThrottleDragRotateLine? horizontalGuidelines? individualGroupable? individualGroupableProps? innerBounds? isDisplayGridGuidelines? isDisplayInnerSnapDigit? isDisplayShadowRoundControls? isDisplaySnapDigit? keepRatio? keepRatioFinally? linePadding? maxRoundControls? maxSnapElementGapDistance? maxSnapElementGuidelineDistance? minRoundControls? origin? originDraggable? originRelative? padding? passDragArea? persistData? pinchable? pinchOutside? pinchThreshold? preventClickDefault? preventClickEventOnDrag? preventDefault? preventRightClick? preventWheelClick? props? renderDirections? resizable? resizeFormat? resolveAblesWithRotatable? rootContainer? rotatable? rotateAroundControls? rotationPosition? rotationTarget? roundable? roundClickable? roundPadding? roundRelative? scalable? scrollable? scrollContainer? scrollOptions? scrollThreshold? scrollThrottleTime? snapContainer? snapDigit? snapDirections? snapDistFormat? snapGap? snapGridAll? snapGridHeight? snapGridWidth? snapHorizontalThreshold? snappable? snapRenderThreshold? snapRotationDegrees? snapRotationThreshold? snapThreshold? snapVerticalThreshold? startDragRotate? stopPropagation? svgOrigin? target? targetGroups? throttleDrag? throttleDragRotate? throttleResize? throttleRotate? throttleScale? transformOrigin? translateZ? triggerAblesSimultaneously? useAccuratePosition? useDefaultGroupRotate? useMutationObserver? useResizeObserver? verticalGuidelines? viewContainer? warpable? zoom?
    ables?: Able<IObject<any>, IObject<any>>[]

    You can add your custom able.

    []
    
    bounds?: BoundType | null

    You can set up boundaries.

    null
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.bounds = { left: 0, right: 1000, top: 0, bottom: 1000};
    checkInput?: boolean

    Checks whether this is an element to input text or contentEditable, and prevents dragging.

    false
    
    checkResizableError?: boolean

    Whether to recalculate when the size to be calculated is different from the actual size

    true
    
    className?: string

    You can specify the className of the moveable controlbox.

    ""
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    className: "",
    });

    moveable.className = "moveable1";
    clickable?: boolean

    Whether to trigger the moveable's click event.

    true
    
    clipArea?: boolean

    You can drag the clip by setting clipArea.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    });
    moveable.on("clipStart", e => {
    console.log(e);
    }).on("clip", e => {
    if (e.clipType === "rect") {
    e.target.style.clip = e.clipStyle;
    } else {
    e.target.style.clipPath = e.clipStyle;
    }
    }).on("clipEnd", e => {
    console.log(e);
    });
    clipHorizontalGuidelines?: (string | number)[]

    Add clip guidelines in the horizontal direction.

    []
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    clipVerticalGuidelines: [0, 100, 200],
    clipHorizontalGuidelines: [0, 100, 200],
    clipSnapThreshold: 5,
    });
    clippable?: boolean | ClippableOptions

    Whether to clip the target.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    });
    moveable.on("clipStart", e => {
    console.log(e);
    }).on("clip", e => {
    if (e.clipType === "rect") {
    e.target.style.clip = e.clipStyle;
    } else {
    e.target.style.clipPath = e.clipStyle;
    }
    }).on("clipEnd", e => {
    console.log(e);
    });
    clipRelative?: boolean

    % Can be used instead of the absolute px (rect not possible)

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    });
    moveable.on("clipStart", e => {
    console.log(e);
    }).on("clip", e => {
    if (e.clipType === "rect") {
    e.target.style.clip = e.clipStyle;
    } else {
    e.target.style.clipPath = e.clipStyle;
    }
    }).on("clipEnd", e => {
    console.log(e);
    });
    clipSnapThreshold?: number

    Distance value that can snap to clip guidelines.

    5
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    clipVerticalGuidelines: [0, 100, 200],
    clipHorizontalGuidelines: [0, 100, 200],
    clipSnapThreshold: 5,
    });
    clipTargetBounds?: boolean

    Whether the clip is bound to the target.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    clipTargetBounds: true,
    });
    moveable.on("clipStart", e => {
    console.log(e);
    }).on("clip", e => {
    if (e.clipType === "rect") {
    e.target.style.clip = e.clipStyle;
    } else {
    e.target.style.clipPath = e.clipStyle;
    }
    }).on("clipEnd", e => {
    console.log(e);
    });
    clipVerticalGuidelines?: (string | number)[]

    Add clip guidelines in the vertical direction.

    []
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    clipVerticalGuidelines: [0, 100, 200],
    clipHorizontalGuidelines: [0, 100, 200],
    clipSnapThreshold: 5,
    });
    container?: SVGElement | HTMLElement | null

    A container into which Moveables are inserted. Set it only when used within the slot of Web Components or when the container is different.

    parentElement
    
    controlPadding?: number

    By adding padding to the control, you can increase the area of the control that can be clicked and dragged. Either rotateAroundControls or displayAroundControls can be used.

    0.44.0

    0
    
    cspNonce?: string

    add nonce property to style for CSP.

    ""
    
    customClipPath?: string

    You can force the custom clipPath. (defaultClipPath < style < customClipPath < dragging clipPath)

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    });
    moveable.on("clipStart", e => {
    console.log(e);
    }).on("clip", e => {
    if (e.clipType === "rect") {
    e.target.style.clip = e.clipStyle;
    } else {
    e.target.style.clipPath = e.clipStyle;
    }
    }).on("clipEnd", e => {
    console.log(e);
    });
    defaultClipPath?: string

    If clippath is not set, the default value can be set. (defaultClipPath < style < customClipPath < dragging clipPath)

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    });
    moveable.on("clipStart", e => {
    console.log(e);
    }).on("clip", e => {
    if (e.clipType === "rect") {
    e.target.style.clip = e.clipStyle;
    } else {
    e.target.style.clipPath = e.clipStyle;
    }
    }).on("clipEnd", e => {
    console.log(e);
    });
    defaultGroupOrigin?: string

    Sets the initial transform origin of the group.

    "50% 50%"
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    target: [].slice.call(document.querySelectorAll(".target")),
    defaultGroupOrigin: "50% 50%",
    });

    moveable.defaultGroupOrigin = "20% 40%";
    defaultGroupRotate?: number

    Sets the initial rotation of the group.

    0
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    target: [].slice.call(document.querySelectorAll(".target")),
    defaultGroupRotate: 0,
    });

    moveable.defaultGroupRotate = 40;
    displayAroundControls?: boolean

    You can expand the area around the control. Either rotateAroundControls or displayAroundControls can be used. You can set the area through the controlPadding value.

    0.44.0

    false
    
    dragArea?: boolean

    Instead of firing an event on the target, we add it to the moveable control element. You can use click and clickGroup events. Add an event to the moveable area instead of the target for stopPropagation.

    if group, true, else fals
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    dragArea: false,
    });
    dragContainer?: Window | MoveableRefType<HTMLElement>

    Container area where drag works

    window
    
    dragFocusedInput?: boolean

    Whether to drag the focused input If checkInput is true, this option is not applied.

    0.47.0

    false
    
    draggable?: boolean

    Whether or not target can be dragged.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.draggable = true;
    dragTarget?: MoveableRefType<SVGElement | HTMLElement>

    The external target(s) to drag Moveable target(s)

    target
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);
    moveable.target = document.querySelector(".target");
    moveable.dragTarget = document.querySelector(".dragTarget");
    dragTargetSelf?: boolean

    If dragTarget is set directly, taget itself cannot be dragged. Whether to drag the target as well.

    false
    
    dragWithClip?: boolean

    When dragging the target, the clip also moves.

    true
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    clippable: true,
    defaultClipPath: "inset",
    customClipPath: "",
    clipRelative: false,
    clipArea: false,
    dragWithClip: true,
    });
    moveable.on("clipStart", e => {
    console.log(e);
    }).on("clip", e => {
    if (e.clipType === "rect") {
    e.target.style.clip = e.clipStyle;
    } else {
    e.target.style.clipPath = e.clipStyle;
    }
    }).on("clipEnd", e => {
    console.log(e);
    });
    edge?: boolean | LineDirection[]

    Whether to scale and resize through edge lines. You can use "n", "w", "s", "e" in LineDirection array.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);
    moveable.edge = true;
    edgeDraggable?: boolean | LineDirection[]

    Whether to move by dragging the edge line

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    draggable: true,
    edgeDraggable: false,
    });

    moveable.edgeDraggable = true;
    elementGuidelines?: (ElementGuidelineValueOption | MoveableRefType<Element>)[]

    Add guidelines for the element.

    []
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.elementGuidelines = [
    document.querySelector(".element"),
    ];
    elementSnapDirections?: boolean | SnapDirections

    You can specify the snap directions of elements.

    true (true is all directions)
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    snappable: true,
    elementSnapDirections: true,
    });
    // snap center
    moveable.elementSnapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };
    flushSync?: (callback: () => void) => void

    If you are using React 18's concurrent mode, use flushSync for UI sync.

    empty function
    
    import { flushSync } from "react-dom";

    <Moveable flushSync={flushSync} />
    getScrollPosition?: (
        e: { direction: number[]; scrollContainer: HTMLElement },
    ) => number[]

    Sets a function to get the scroll position.

    scrollContainer's scrollTop, scrollLeft
    
    groupableProps?: Record<string, any>

    Props that work when group

    {
    roundable: true,
    groupableProps: {
    roundable: false,
    },
    }
    hideChildMoveableDefaultLines?: boolean

    Whether to hide the line in child moveable for group corresponding to the rect of the target.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    target: [].slice.call(document.querySelectorAll(".target")),
    hideChildMoveableDefaultLines: false,
    });

    moveable.hideChildMoveableDefaultLines = true;
    hideDefaultLines?: boolean

    Whether to hide the line corresponding to the rect of the target.

    false
    
    hideThrottleDragRotateLine?: boolean

    Hides the guidelines that appear when using the throttleDragRotate prop.

    false
    
    horizontalGuidelines?: (string | number | PosGuideline)[]

    Add guidelines in the horizontal direction.

    []
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.horizontalGuidelines = [100, 200, 500];
    individualGroupable?: boolean

    Create targets individually, not as a group.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    target: [].slice.call(document.querySelectorAll(".target")),
    individualGroupable: true,
    });
    individualGroupableProps?: (
        element: SVGElement | HTMLElement | null | undefined,
        index: number,
    ) => void | Record<string, any> | null | undefined

    When using individualGroupable you can pass props to child moveable.

    0.44.0

    innerBounds?: InnerBoundType | null

    You can set up inner boundaries.

    null
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.innerBounds = { left: 500, top: 500, width: 100, height: 100};
    isDisplayGridGuidelines?: boolean

    Whether to show guideline of snap by grid

    false
    
    isDisplayInnerSnapDigit?: boolean

    Whether to show element inner snap distance

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.isDisplayInnerSnapDigit = true;
    isDisplayShadowRoundControls?: boolean | "horizontal"

    Whether to show a round control that does not actually exist as a shadow

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    isDisplayShadowRoundControls: false,
    });
    moveable.isDisplayShadowRoundControls = true;
    isDisplaySnapDigit?: boolean

    Whether to show snap distance.

    true
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.isDisplaySnapDigit = true;
    keepRatio?: boolean

    When resize or scale, keeps a ratio of the width, height.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    scalable: true,
    });

    moveable.keepRatio = true;
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    resizable: true,
    });

    moveable.keepRatio = true;
    keepRatioFinally?: boolean

    The size can be changed by format and throttle, but the ratio is maintained at the end. Forced true when using groups.

    false
    
    linePadding?: number

    By adding padding to the line, you can increase the area of the line that can be clicked and dragged.

    0.43.0

    0
    
    maxRoundControls?: number[]

    Maximum number of round controls. It moves in proportion by control. [horizontal, vertical]

    [4, 4]
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    maxRoundControls: [4, 4],
    });
    moveable.maxRoundControls = [1, 0];
    maxSnapElementGapDistance?: number

    Maximum distance to which element gap guidelines can be snapped.

    Infinity
    
    maxSnapElementGuidelineDistance?: number

    Maximum distance to which element guidelines can be snapped.

    Infinity
    
    minRoundControls?: number[]

    Minimum number of round controls. It moves in proportion by control. [horizontal, vertical]

    [0, 0]
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    minRoundControls: [0, 0],
    });
    moveable.minRoundControls = [1, 0];
    origin?: boolean

    Whether or not the origin control box will be visible or not.

    true
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.origin = true;
    originDraggable?: boolean

    Whether to drag origin.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    originDraggable: true,
    });
    let translate = [0, 0];
    moveable.on("dragOriginStart", e => {
    e.dragStart && e.dragStart.set(translate);
    }).on("dragOrigin", e => {
    translate = e.drag.beforeTranslate;
    e.target.style.cssText
    = `transform-origin: ${e.transformOrigin};`
    + `transform: translate(${translate[0]}px, ${translate[1]}px)`;
    }).on("dragOriginEnd", e => {
    console.log(e);
    });
    originRelative?: boolean

    % Can be used instead of the absolute px.

    true
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    originDraggable: true,
    originRelative: false,
    });
    moveable.originRelative = true;
    padding?: number | PaddingBox

    Add padding around the target to increase the drag area.

    null
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    target: document.querySelector(".target"),
    padding: { left: 0, top: 0, right: 0, bottom: 0 },
    });
    moveable.padding = { left: 10, top: 10, right: 10, bottom: 10 },
    moveable.updateRect();
    passDragArea?: boolean

    Set pointerEvents: none; css to pass events in dragArea.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    dragArea: false,
    });
    persistData?: PersistRectData | null

    Data for first render

    null
    
    pinchable?: boolean | ("rotatable" | "resizable" | "scalable")[]

    Whether or not target can be pinched with draggable, resizable, scalable, rotatable.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.pinchable = true;
    pinchOutside?: boolean

    Whether the container containing the target becomes a pinch.

    true
    
    pinchThreshold?: number

    Minimum distance to pinch.

    20
    
    preventClickDefault?: boolean

    Prevent click event on dragStart. (mousedown, touchstart)

    false
    
    preventClickEventOnDrag?: boolean

    Prevent click event on drag. (mousemove, touchmove)

    true
    
    preventDefault?: boolean

    Whether to call preventDefault on touchstart or mousedown

    0.44.0

    true
    
    preventRightClick?: boolean

    Whether to prevent dragging using the right mouse button

    true
    
    preventWheelClick?: boolean

    Whether to prevent dragging using the wheel (middle) mouse button

    true
    
    props?: Record<string, any>

    You can use props in object format or custom props.

    empty object
    
    renderDirections?: boolean | string[]

    Set directions to show the control box.

    false if rotatable, ["n", "nw", "ne", "s", "se", "sw", "e", "w"] otherwise
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    warpable: true,
    renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
    });

    moveable.renderDirections = ["nw", "ne", "sw", "se"];
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    scalable: true,
    renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
    });

    moveable.renderDirections = ["nw", "ne", "sw", "se"];
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    resizable: true,
    renderDirections: ["n", "nw", "ne", "s", "se", "sw", "e", "w"],
    });

    moveable.renderDirections = ["nw", "ne", "sw", "se"];
    resizable?: boolean | ResizableOptions

    Whether or not target can be resized.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    resizable: false,
    });

    moveable.resizable = true;
    resizeFormat?: (size: number[]) => number[]

    Function to convert size for resize.

    oneself
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    resizable: true,
    resizeFormat: v => v,
    });

    moveable.resizeFormat = (size: number[]) => ([Math.trunc(size[0]), Math.trunc(size[1])];
    resolveAblesWithRotatable?: Record<string, LineDirection[]> | null

    Sets the control that will cause resize along with rotate. (Only Single Target, Only resizable, Beta)

    null
    
    rootContainer?: MoveableRefType<HTMLElement>

    Moveable Root Container (No Transformed Container)

    parentElement
    
    rotatable?: boolean | RotatableOptions

    Whether or not target can be rotated.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.rotatable = true;
    rotateAroundControls?: boolean

    You can rotate around direction controls. Either rotateAroundControls or displayAroundControls can be used.

    0
    
    rotationPosition?: RotationPosition | RotationPosition[]

    You can specify the position of the rotation.

    "top"
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    rotationPosition: "top",
    });

    moveable.rotationPosition = "bottom"
    rotationTarget?:
        | false
        | MoveableRefType<SVGElement | HTMLElement>
        | ArrayFormat<MoveableRefType<SVGElement | HTMLElement>>

    Set additional rotationTargets.

    null
    
    roundable?: boolean

    Whether to show and drag or double click border-radius.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    });
    moveable.on("roundStart", e => {
    console.log(e);
    }).on("round", e => {
    e.target.style.borderRadius = e.borderRadius;
    }).on("roundEnd", e => {
    console.log(e);
    });
    roundClickable?: boolean | "control" | "line"

    Whether you can add/delete round controls by double-clicking a line or control.

    true
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    roundClickable: true,
    });
    moveable.roundClickable = false;
    roundPadding?: number

    The padding value of the position of the round control

    0
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundPadding: 0,
    });
    moveable.roundPadding = 15;
    roundRelative?: boolean

    % Can be used instead of the absolute px

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    });
    moveable.on("roundStart", e => {
    console.log(e);
    }).on("round", e => {
    e.target.style.borderRadius = e.borderRadius;
    }).on("roundEnd", e => {
    console.log(e);
    });
    scalable?: boolean | ScalableOptions

    Whether or not target can be scaled.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.scalable = true;
    scrollable?: boolean

    Whether or not target can be scrolled to the scroll container

    false
    
    scrollContainer?: MoveableRefType<HTMLElement>

    The container to which scroll is applied

    container
    
    scrollOptions?: Partial<DragScrollOptions> | null

    Option to scroll with dragging

    0.43.0

    const scrollOptions = {
    container: () => viewer.getContainer(),
    threshold: 20,
    getScrollPosition: () => {
    return [
    viewer.getScrollLeft({ absolute: true }),
    viewer.getScrollTop({ absolute: true }),
    ];
    },
    };
    scrollThreshold?: number

    Expand the range of the scroll check area.

    0
    
    scrollThrottleTime?: number

    Time interval that occurs when scrolling occurs when dragging is maintained If set to 0, it does not occur.

    0
    
    snapContainer?: MoveableRefType<SVGElement | HTMLElement>

    A snap container that is the basis for snap, bounds, and innerBounds.

    null
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.querySelector(".container"));

    moveable.snapContainer = document.body;
    snapDigit?: number

    snap distance digits.

    0
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.snapDigit = 0
    snapDirections?: boolean | SnapDirections

    You can specify the directions to snap to the target.

    true (true is all directions)
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    snappable: true,
    snapDirections: true,
    });
    // snap center
    moveable.snapDirections = { left: true, top: true, right: true, bottom: true, center: true, middle: true };
    snapDistFormat?: (
        distance: number,
        type: "horizontal" | "vertical",
    ) => string | number

    You can set the text format of the distance shown in the guidelines.

    oneself
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    snappable: true,
    snapDistFormat: (v, type) => v,
    });
    moveable.snapDistFormat = (v, type) => `${v}px`;
    snapGap?: boolean

    When you drag, make the gap snap in the element guidelines.

    true
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    snappable: true,
    snapElement: true,
    snapGap: true,
    });

    moveable.snapGap = false;
    snapGridAll?: boolean

    In the case of a group, if snapGridWidth and snapGridHeight are used, all children can be snapped. Custom fixed directions are not yet allowed. Also, it cannot be applied if rotated.

    false
    
    snapGridHeight?: number

    If height size is greater than 0, you can horizontal snap to the grid.

    0 (0 is not used)
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.snapGridHeight = 5;
    snapGridWidth?: number

    If width size is greater than 0, you can vertical snap to the grid.

    0 (0 is not used)
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.snapGridWidth = 5;
    snapHorizontalThreshold?: number

    Distance horizontal between horizontal value that can snap to guidelines.

    5
    
    snappable?: boolean | string[]

    Whether or not target can be snapped to the guideline.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.snappable = true;
    snapRenderThreshold?: number

    Distance value that render snapped guidelines.

    1
    
    snapRotationDegrees?: number[]

    degree angles to snap to rotation

    []
    
    snapRotationThreshold?: number

    Snap works if abs(current rotation - snapRotationDegrees) < snapRotationThreshold.

    5
    
    snapThreshold?: number

    /**

    • Distance value that can snap to guidelines.
    • Use snapHorizontalThreshold and snapVerticalThreshold
    0
    *
    * import Moveable from "@moveable-next/vanilla";
    *
    * const moveable = new Moveable(document.body);
    *
    * moveable.snapThreshold = 5;
    snapVerticalThreshold?: number

    Distance Horizontal value that can snap to guidelines.

    5
    
    startDragRotate?: number

    start angle(degree) of x,y for throttleDragRotate when drag.

    0
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    // 45, 135, 225, 315
    moveable.throttleDragRotate = 90;
    moveable.startDragRotate = 45;
    stopPropagation?: boolean

    Whether to prevent bubbling of events like mousedown, touchstart, etc.

    false
    
    svgOrigin?: string

    Sets the transform origin based on the svg target. If not set, it is set as the transform origin based on the owner of svg.

    0.47.0

    ""
    

    The target to indicate Moveable Control Box.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);
    moveable.target = document.querySelector(".target");

    The nested groups of the targets, made from the nested arrays in target. Moveable sets it itself when it renders a group.

    throttleDrag?: number

    throttle of x, y when drag.

    0
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.throttleDrag = 1;
    throttleDragRotate?: number

    throttle of angle(degree) of x,y when drag.

    0
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.throttleDragRotate = 45;
    throttleResize?: number

    throttle of width, height when resize. If throttleResize is set to less than 1, the target may shake.

    1
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    resizable: true,
    throttleResize: 1,
    });

    moveable.throttleResize = 0;
    throttleRotate?: number

    throttle of angle(degree) when rotate.

    0
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.throttleRotate = 1;
    throttleScale?: number

    throttle of scaleX, scaleY when scale.

    0
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.throttleScale = 0.1;
    transformOrigin?: string | (string | number)[]

    The default transformOrigin of the target can be set in advance.

    ""
    
    translateZ?: string | number

    You can set the translateZ value of moveable.

    50
    
    triggerAblesSimultaneously?: boolean

    Lets generate events of ables at the same time. (like Resizable, Scalable)

    false
    
    useAccuratePosition?: boolean

    Whether to accurately show the position of a movable control box Because getBoundingClientRect is used, css zoom, transform: rotate between container and rootContainer cannot be used. group is not supported.

    false
    
    useDefaultGroupRotate?: boolean

    Use the defaultGroupRotate even if the children's rotations match.

    false
    
    useMutationObserver?: boolean

    Whether the target size, pos in inline style is detected and updated whenever it changes. It is more effective when used together with useResizeObserver.

    false
    
    useResizeObserver?: boolean

    Whether the target size is detected and updated whenever it changes. It is more effective when used together with useMutationObserver.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);
    moveable.useResizeObserver = true;
    verticalGuidelines?: (string | number | PosGuideline)[]

    Add guidelines in the vertical direction.

    []
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.verticalGuidelines = [100, 200, 500];
    viewContainer?: MoveableRefType<HTMLElement>

    If you want to set the dragging information to the viewer, refer to the following.

    null
    
    warpable?: boolean

    Whether or not target can be warped.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);

    moveable.warpable = true;
    zoom?: number

    Zooms in the elements of a moveable.

    1
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body);
    moveable.zoom = 2;