Options for the move-to animation.

interface MoveToOptions {
    alignment:
        | "center center"
        | "center top"
        | "center bottom"
        | "left center"
        | "left top"
        | "left bottom"
        | "right center"
        | "right top"
        | "right bottom";
    preserveX: boolean;
    preserveY: boolean;
    selfOffset:
        | `${number}px, ${number}px`
        | `${number}px, ${number}rem`
        | `${number}px, ${number}%`
        | `${number}rem, ${number}px`
        | `${number}rem, ${number}rem`
        | `${number}rem, ${number}%`
        | `${number}%, ${number}px`
        | `${number}%, ${number}rem`
        | `${number}%, ${number}%`;
    targetOffset:
        | `${number}px, ${number}px`
        | `${number}px, ${number}rem`
        | `${number}px, ${number}%`
        | `${number}rem, ${number}px`
        | `${number}rem, ${number}rem`
        | `${number}rem, ${number}%`
        | `${number}%, ${number}px`
        | `${number}%, ${number}rem`
        | `${number}%, ${number}%`;
}

Hierarchy

  • TranslationOffset
    • MoveToOptions

Properties

alignment:
    | "center center"
    | "center top"
    | "center bottom"
    | "left center"
    | "left top"
    | "left bottom"
    | "right center"
    | "right top"
    | "right bottom"

determines horizontal and vertical alignment with target element

preserveX: boolean

if true, there will be no horizontal translation with respect to the target element (offsets still apply)

preserveY: boolean

if true, there will be no vertical translation with respect to the target element (offsets still apply)

selfOffset:
    | `${number}px, ${number}px`
    | `${number}px, ${number}rem`
    | `${number}px, ${number}%`
    | `${number}rem, ${number}px`
    | `${number}rem, ${number}rem`
    | `${number}rem, ${number}%`
    | `${number}%, ${number}px`
    | `${number}%, ${number}rem`
    | `${number}%, ${number}%`

determines offsets to apply to both X and Y positional components

{selfOffset: "12px, 50%"}
targetOffset:
    | `${number}px, ${number}px`
    | `${number}px, ${number}rem`
    | `${number}px, ${number}%`
    | `${number}rem, ${number}px`
    | `${number}rem, ${number}rem`
    | `${number}rem, ${number}%`
    | `${number}%, ${number}px`
    | `${number}%, ${number}rem`
    | `${number}%, ${number}%`

offset with respect to target's left and top bound

{targetOffset: "12px, 50%"} // move 12px right and 50% of target element's height down