Moveable
    Preparing search index...

    Interface ResizableOptions

    interface ResizableOptions {
        checkResizableError?: boolean;
        displayAroundControls?: boolean;
        edge?: boolean | LineDirection[];
        keepRatio?: boolean;
        keepRatioFinally?: boolean;
        renderDirections?: boolean | string[];
        resizable?: boolean | ResizableOptions;
        resizeFormat?: (size: number[]) => number[];
        throttleResize?: number;
    }

    Hierarchy (View Summary)

    Index
    checkResizableError?: boolean

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

    true
    
    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
    
    edge?: boolean | LineDirection[]

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

    false
    
    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
    
    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])];
    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;