interface RowProps {
    _dragX?: MotionValue<number>;
    _dragY?: MotionValue<number>;
    about?: string;
    accessKey?: string;
    align?: ResponsiveValue<undefined | "top" | "bottom" | "middle" | "stretch" | ResponsiveAligns>;
    animate?: boolean | VariantLabels | AnimationControls | TargetAndTransition;
    aria-activedescendant?: string;
    aria-atomic?: Booleanish;
    aria-autocomplete?: "none" | "inline" | "both" | "list";
    aria-braillelabel?: string;
    aria-brailleroledescription?: string;
    aria-busy?: Booleanish;
    aria-checked?: boolean | "true" | "false" | "mixed";
    aria-colcount?: number;
    aria-colindex?: number;
    aria-colindextext?: string;
    aria-colspan?: number;
    aria-controls?: string;
    aria-current?: boolean | "date" | "time" | "true" | "false" | "page" | "step" | "location";
    aria-describedby?: string;
    aria-description?: string;
    aria-details?: string;
    aria-disabled?: Booleanish;
    aria-dropeffect?: "link" | "copy" | "none" | "move" | "execute" | "popup";
    aria-errormessage?: string;
    aria-expanded?: Booleanish;
    aria-flowto?: string;
    aria-grabbed?: Booleanish;
    aria-haspopup?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree";
    aria-hidden?: Booleanish;
    aria-invalid?: boolean | "true" | "false" | "grammar" | "spelling";
    aria-keyshortcuts?: string;
    aria-label?: string;
    aria-labelledby?: string;
    aria-level?: number;
    aria-live?: "off" | "assertive" | "polite";
    aria-modal?: Booleanish;
    aria-multiline?: Booleanish;
    aria-multiselectable?: Booleanish;
    aria-orientation?: "horizontal" | "vertical";
    aria-owns?: string;
    aria-placeholder?: string;
    aria-posinset?: number;
    aria-pressed?: boolean | "true" | "false" | "mixed";
    aria-readonly?: Booleanish;
    aria-relevant?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals";
    aria-required?: Booleanish;
    aria-roledescription?: string;
    aria-rowcount?: number;
    aria-rowindex?: number;
    aria-rowindextext?: string;
    aria-rowspan?: number;
    aria-selected?: Booleanish;
    aria-setsize?: number;
    aria-sort?: "none" | "ascending" | "descending" | "other";
    aria-valuemax?: number;
    aria-valuemin?: number;
    aria-valuenow?: number;
    aria-valuetext?: string;
    autoCapitalize?: string;
    autoCorrect?: string;
    autoFocus?: boolean;
    autoSave?: string;
    children?: ReactNode | MotionValue<number> | MotionValue<string>;
    className?: string;
    colon?: boolean;
    color?: string;
    content?: string;
    contentEditable?: "inherit" | Booleanish | "plaintext-only";
    contextMenu?: string;
    custom?: any;
    dangerouslySetInnerHTML?: {
        __html: string | TrustedHTML;
    };
    datatype?: string;
    defaultChecked?: boolean;
    defaultValue?: string | number | readonly string[];
    dir?: string;
    drag?: boolean | "x" | "y";
    dragConstraints?: false | Partial<BoundingBox> | RefObject<Element>;
    dragControls?: DragControls;
    dragDirectionLock?: boolean;
    dragElastic?: DragElastic;
    dragListener?: boolean;
    dragMomentum?: boolean;
    dragPropagation?: boolean;
    dragSnapToOrigin?: boolean;
    dragTransition?: Partial<Omit<Inertia, "type" | "velocity">>;
    draggable?: Booleanish;
    exit?: VariantLabels | TargetAndTransition;
    finishingDisabled?: boolean;
    form?: Omit<FormProps<Record<string, any>>, "colon" | "lazy" | "initialValues" | "onFinish" | "finishingDisabled" | "interactiveInitialValues">;
    globalTapTarget?: boolean;
    gutter?: ResponsiveValue<Gutter | [Gutter, Gutter]>;
    hidden?: boolean;
    id?: string;
    ignoreStrict?: boolean;
    inherit?: boolean;
    initial?: boolean | MakeCustomValueType<TargetProperties> | VariantLabels;
    initialValues?: Record<string, any>;
    inlist?: any;
    inputMode?: "search" | "text" | "email" | "url" | "none" | "tel" | "numeric" | "decimal";
    interactiveInitialValues?: boolean;
    is?: string;
    itemID?: string;
    itemProp?: string;
    itemRef?: string;
    itemScope?: boolean;
    itemType?: string;
    justify?: ResponsiveValue<undefined | "center" | "end" | "start" | "space-around" | "space-between" | "space-evenly" | ResponsiveJustify>;
    lang?: string;
    layout?: boolean | "size" | "position" | "preserve-aspect";
    layoutDependency?: any;
    layoutId?: string;
    layoutRoot?: boolean;
    layoutScroll?: boolean;
    lazy?: true;
    nonce?: string;
    onAbort?: ReactEventHandler<HTMLDivElement>;
    onAbortCapture?: ReactEventHandler<HTMLDivElement>;
    onAnimationEnd?: AnimationEventHandler<HTMLDivElement>;
    onAnimationEndCapture?: AnimationEventHandler<HTMLDivElement>;
    onAnimationIteration?: AnimationEventHandler<HTMLDivElement>;
    onAnimationIterationCapture?: AnimationEventHandler<HTMLDivElement>;
    onAnimationStartCapture?: AnimationEventHandler<HTMLDivElement>;
    onAuxClick?: MouseEventHandler<HTMLDivElement>;
    onAuxClickCapture?: MouseEventHandler<HTMLDivElement>;
    onBeforeInput?: FormEventHandler<HTMLDivElement>;
    onBeforeInputCapture?: FormEventHandler<HTMLDivElement>;
    onBlur?: FocusEventHandler<HTMLDivElement>;
    onBlurCapture?: FocusEventHandler<HTMLDivElement>;
    onCanPlay?: ReactEventHandler<HTMLDivElement>;
    onCanPlayCapture?: ReactEventHandler<HTMLDivElement>;
    onCanPlayThrough?: ReactEventHandler<HTMLDivElement>;
    onCanPlayThroughCapture?: ReactEventHandler<HTMLDivElement>;
    onChange?: FormEventHandler<HTMLDivElement>;
    onChangeCapture?: FormEventHandler<HTMLDivElement>;
    onClick?: MouseEventHandler<HTMLDivElement>;
    onClickCapture?: MouseEventHandler<HTMLDivElement>;
    onCompositionEnd?: CompositionEventHandler<HTMLDivElement>;
    onCompositionEndCapture?: CompositionEventHandler<HTMLDivElement>;
    onCompositionStart?: CompositionEventHandler<HTMLDivElement>;
    onCompositionStartCapture?: CompositionEventHandler<HTMLDivElement>;
    onCompositionUpdate?: CompositionEventHandler<HTMLDivElement>;
    onCompositionUpdateCapture?: CompositionEventHandler<HTMLDivElement>;
    onContextMenu?: MouseEventHandler<HTMLDivElement>;
    onContextMenuCapture?: MouseEventHandler<HTMLDivElement>;
    onCopy?: ClipboardEventHandler<HTMLDivElement>;
    onCopyCapture?: ClipboardEventHandler<HTMLDivElement>;
    onCut?: ClipboardEventHandler<HTMLDivElement>;
    onCutCapture?: ClipboardEventHandler<HTMLDivElement>;
    onDoubleClick?: MouseEventHandler<HTMLDivElement>;
    onDoubleClickCapture?: MouseEventHandler<HTMLDivElement>;
    onDragCapture?: DragEventHandler<HTMLDivElement>;
    onDragEndCapture?: DragEventHandler<HTMLDivElement>;
    onDragEnter?: DragEventHandler<HTMLDivElement>;
    onDragEnterCapture?: DragEventHandler<HTMLDivElement>;
    onDragExit?: DragEventHandler<HTMLDivElement>;
    onDragExitCapture?: DragEventHandler<HTMLDivElement>;
    onDragLeave?: DragEventHandler<HTMLDivElement>;
    onDragLeaveCapture?: DragEventHandler<HTMLDivElement>;
    onDragOver?: DragEventHandler<HTMLDivElement>;
    onDragOverCapture?: DragEventHandler<HTMLDivElement>;
    onDragStartCapture?: DragEventHandler<HTMLDivElement>;
    onDrop?: DragEventHandler<HTMLDivElement>;
    onDropCapture?: DragEventHandler<HTMLDivElement>;
    onDurationChange?: ReactEventHandler<HTMLDivElement>;
    onDurationChangeCapture?: ReactEventHandler<HTMLDivElement>;
    onEmptied?: ReactEventHandler<HTMLDivElement>;
    onEmptiedCapture?: ReactEventHandler<HTMLDivElement>;
    onEncrypted?: ReactEventHandler<HTMLDivElement>;
    onEncryptedCapture?: ReactEventHandler<HTMLDivElement>;
    onEnded?: ReactEventHandler<HTMLDivElement>;
    onEndedCapture?: ReactEventHandler<HTMLDivElement>;
    onError?: ReactEventHandler<HTMLDivElement>;
    onErrorCapture?: ReactEventHandler<HTMLDivElement>;
    onFinish?: ((values) => void);
    onFocus?: FocusEventHandler<HTMLDivElement>;
    onFocusCapture?: FocusEventHandler<HTMLDivElement>;
    onGotPointerCapture?: PointerEventHandler<HTMLDivElement>;
    onGotPointerCaptureCapture?: PointerEventHandler<HTMLDivElement>;
    onInput?: FormEventHandler<HTMLDivElement>;
    onInputCapture?: FormEventHandler<HTMLDivElement>;
    onInvalid?: FormEventHandler<HTMLDivElement>;
    onInvalidCapture?: FormEventHandler<HTMLDivElement>;
    onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
    onKeyDownCapture?: KeyboardEventHandler<HTMLDivElement>;
    onKeyPress?: KeyboardEventHandler<HTMLDivElement>;
    onKeyPressCapture?: KeyboardEventHandler<HTMLDivElement>;
    onKeyUp?: KeyboardEventHandler<HTMLDivElement>;
    onKeyUpCapture?: KeyboardEventHandler<HTMLDivElement>;
    onLoad?: ReactEventHandler<HTMLDivElement>;
    onLoadCapture?: ReactEventHandler<HTMLDivElement>;
    onLoadStart?: ReactEventHandler<HTMLDivElement>;
    onLoadStartCapture?: ReactEventHandler<HTMLDivElement>;
    onLoadedData?: ReactEventHandler<HTMLDivElement>;
    onLoadedDataCapture?: ReactEventHandler<HTMLDivElement>;
    onLoadedMetadata?: ReactEventHandler<HTMLDivElement>;
    onLoadedMetadataCapture?: ReactEventHandler<HTMLDivElement>;
    onLostPointerCapture?: PointerEventHandler<HTMLDivElement>;
    onLostPointerCaptureCapture?: PointerEventHandler<HTMLDivElement>;
    onMeasureDragConstraints?: ((constraints) => void | BoundingBox);
    onMouseDown?: MouseEventHandler<HTMLDivElement>;
    onMouseDownCapture?: MouseEventHandler<HTMLDivElement>;
    onMouseEnter?: MouseEventHandler<HTMLDivElement>;
    onMouseLeave?: MouseEventHandler<HTMLDivElement>;
    onMouseMove?: MouseEventHandler<HTMLDivElement>;
    onMouseMoveCapture?: MouseEventHandler<HTMLDivElement>;
    onMouseOut?: MouseEventHandler<HTMLDivElement>;
    onMouseOutCapture?: MouseEventHandler<HTMLDivElement>;
    onMouseOver?: MouseEventHandler<HTMLDivElement>;
    onMouseOverCapture?: MouseEventHandler<HTMLDivElement>;
    onMouseUp?: MouseEventHandler<HTMLDivElement>;
    onMouseUpCapture?: MouseEventHandler<HTMLDivElement>;
    onPaste?: ClipboardEventHandler<HTMLDivElement>;
    onPasteCapture?: ClipboardEventHandler<HTMLDivElement>;
    onPause?: ReactEventHandler<HTMLDivElement>;
    onPauseCapture?: ReactEventHandler<HTMLDivElement>;
    onPlay?: ReactEventHandler<HTMLDivElement>;
    onPlayCapture?: ReactEventHandler<HTMLDivElement>;
    onPlaying?: ReactEventHandler<HTMLDivElement>;
    onPlayingCapture?: ReactEventHandler<HTMLDivElement>;
    onPointerCancel?: PointerEventHandler<HTMLDivElement>;
    onPointerCancelCapture?: PointerEventHandler<HTMLDivElement>;
    onPointerDown?: PointerEventHandler<HTMLDivElement>;
    onPointerDownCapture?: PointerEventHandler<HTMLDivElement>;
    onPointerEnter?: PointerEventHandler<HTMLDivElement>;
    onPointerEnterCapture?: PointerEventHandler<HTMLDivElement>;
    onPointerLeave?: PointerEventHandler<HTMLDivElement>;
    onPointerLeaveCapture?: PointerEventHandler<HTMLDivElement>;
    onPointerMove?: PointerEventHandler<HTMLDivElement>;
    onPointerMoveCapture?: PointerEventHandler<HTMLDivElement>;
    onPointerOut?: PointerEventHandler<HTMLDivElement>;
    onPointerOutCapture?: PointerEventHandler<HTMLDivElement>;
    onPointerOver?: PointerEventHandler<HTMLDivElement>;
    onPointerOverCapture?: PointerEventHandler<HTMLDivElement>;
    onPointerUp?: PointerEventHandler<HTMLDivElement>;
    onPointerUpCapture?: PointerEventHandler<HTMLDivElement>;
    onProgress?: ReactEventHandler<HTMLDivElement>;
    onProgressCapture?: ReactEventHandler<HTMLDivElement>;
    onRateChange?: ReactEventHandler<HTMLDivElement>;
    onRateChangeCapture?: ReactEventHandler<HTMLDivElement>;
    onReset?: FormEventHandler<HTMLDivElement>;
    onResetCapture?: FormEventHandler<HTMLDivElement>;
    onResize?: ReactEventHandler<HTMLDivElement>;
    onResizeCapture?: ReactEventHandler<HTMLDivElement>;
    onScroll?: UIEventHandler<HTMLDivElement>;
    onScrollCapture?: UIEventHandler<HTMLDivElement>;
    onSeeked?: ReactEventHandler<HTMLDivElement>;
    onSeekedCapture?: ReactEventHandler<HTMLDivElement>;
    onSeeking?: ReactEventHandler<HTMLDivElement>;
    onSeekingCapture?: ReactEventHandler<HTMLDivElement>;
    onSelect?: ReactEventHandler<HTMLDivElement>;
    onSelectCapture?: ReactEventHandler<HTMLDivElement>;
    onStalled?: ReactEventHandler<HTMLDivElement>;
    onStalledCapture?: ReactEventHandler<HTMLDivElement>;
    onSubmit?: FormEventHandler<HTMLDivElement>;
    onSubmitCapture?: FormEventHandler<HTMLDivElement>;
    onSuspend?: ReactEventHandler<HTMLDivElement>;
    onSuspendCapture?: ReactEventHandler<HTMLDivElement>;
    onTimeUpdate?: ReactEventHandler<HTMLDivElement>;
    onTimeUpdateCapture?: ReactEventHandler<HTMLDivElement>;
    onTouchCancel?: TouchEventHandler<HTMLDivElement>;
    onTouchCancelCapture?: TouchEventHandler<HTMLDivElement>;
    onTouchEnd?: TouchEventHandler<HTMLDivElement>;
    onTouchEndCapture?: TouchEventHandler<HTMLDivElement>;
    onTouchMove?: TouchEventHandler<HTMLDivElement>;
    onTouchMoveCapture?: TouchEventHandler<HTMLDivElement>;
    onTouchStart?: TouchEventHandler<HTMLDivElement>;
    onTouchStartCapture?: TouchEventHandler<HTMLDivElement>;
    onTransitionEnd?: TransitionEventHandler<HTMLDivElement>;
    onTransitionEndCapture?: TransitionEventHandler<HTMLDivElement>;
    onViewportEnter?: ViewportEventHandler;
    onViewportLeave?: ViewportEventHandler;
    onVolumeChange?: ReactEventHandler<HTMLDivElement>;
    onVolumeChangeCapture?: ReactEventHandler<HTMLDivElement>;
    onWaiting?: ReactEventHandler<HTMLDivElement>;
    onWaitingCapture?: ReactEventHandler<HTMLDivElement>;
    onWheel?: WheelEventHandler<HTMLDivElement>;
    onWheelCapture?: WheelEventHandler<HTMLDivElement>;
    prefix?: string;
    prefixCls?: string;
    property?: string;
    radioGroup?: string;
    rel?: string;
    resource?: string;
    results?: number;
    rev?: string;
    role?: AriaRole;
    security?: string;
    slot?: string;
    spellCheck?: Booleanish;
    style?: MotionStyle;
    suppressContentEditableWarning?: boolean;
    suppressHydrationWarning?: boolean;
    tabIndex?: number;
    title?: string;
    transition?: Transition;
    translate?: "no" | "yes";
    tw?: string;
    typeof?: string;
    unselectable?: "on" | "off";
    variants?: Variants;
    viewport?: ViewportOptions;
    vocab?: string;
    whileDrag?: VariantLabels | TargetAndTransition;
    whileFocus?: VariantLabels | TargetAndTransition;
    whileHover?: VariantLabels | TargetAndTransition;
    whileInView?: VariantLabels | TargetAndTransition;
    whileTap?: VariantLabels | TargetAndTransition;
    wrap?: boolean;
    onAnimationComplete?(definition): void;
    onAnimationStart?(definition): void;
    onBeforeLayoutMeasure?(box): void;
    onDirectionLock?(axis): void;
    onDrag?(event, info): void;
    onDragEnd?(event, info): void;
    onDragStart?(event, info): void;
    onDragTransitionEnd?(): void;
    onHoverEnd?(event, info): void;
    onHoverStart?(event, info): void;
    onLayoutAnimationComplete?(): void;
    onLayoutAnimationStart?(): void;
    onLayoutMeasure?(box, prevBox): void;
    onPan?(event, info): void;
    onPanEnd?(event, info): void;
    onPanSessionStart?(event, info): void;
    onPanStart?(event, info): void;
    onTap?(event, info): void;
    onTapCancel?(event, info): void;
    onTapStart?(event, info): void;
    onUpdate?(latest): void;
    transformTemplate?(transform, generatedTransform): string;
}

Hierarchy

Properties

_dragX? _dragY? about? accessKey? align? animate? aria-activedescendant? aria-atomic? aria-autocomplete? aria-braillelabel? aria-brailleroledescription? aria-busy? aria-checked? aria-colcount? aria-colindex? aria-colindextext? aria-colspan? aria-controls? aria-current? aria-describedby? aria-description? aria-details? aria-disabled? aria-dropeffect? aria-errormessage? aria-expanded? aria-flowto? aria-grabbed? aria-haspopup? aria-hidden? aria-invalid? aria-keyshortcuts? aria-label? aria-labelledby? aria-level? aria-live? aria-modal? aria-multiline? aria-multiselectable? aria-orientation? aria-owns? aria-placeholder? aria-posinset? aria-pressed? aria-readonly? aria-relevant? aria-required? aria-roledescription? aria-rowcount? aria-rowindex? aria-rowindextext? aria-rowspan? aria-selected? aria-setsize? aria-sort? aria-valuemax? aria-valuemin? aria-valuenow? aria-valuetext? autoCapitalize? autoCorrect? autoFocus? autoSave? children? className? colon? color? content? contentEditable? contextMenu? custom? dangerouslySetInnerHTML? datatype? defaultChecked? defaultValue? dir? drag? dragConstraints? dragControls? dragDirectionLock? dragElastic? dragListener? dragMomentum? dragPropagation? dragSnapToOrigin? dragTransition? draggable? exit? finishingDisabled? form? globalTapTarget? gutter? hidden? id? ignoreStrict? inherit? initial? initialValues? inlist? inputMode? interactiveInitialValues? is? itemID? itemProp? itemRef? itemScope? itemType? justify? lang? layout? layoutDependency? layoutId? layoutRoot? layoutScroll? lazy? nonce? onAbort? onAbortCapture? onAnimationEnd? onAnimationEndCapture? onAnimationIteration? onAnimationIterationCapture? onAnimationStartCapture? onAuxClick? onAuxClickCapture? onBeforeInput? onBeforeInputCapture? onBlur? onBlurCapture? onCanPlay? onCanPlayCapture? onCanPlayThrough? onCanPlayThroughCapture? onChange? onChangeCapture? onClick? onClickCapture? onCompositionEnd? onCompositionEndCapture? onCompositionStart? onCompositionStartCapture? onCompositionUpdate? onCompositionUpdateCapture? onContextMenu? onContextMenuCapture? onCopy? onCopyCapture? onCut? onCutCapture? onDoubleClick? onDoubleClickCapture? onDragCapture? onDragEndCapture? onDragEnter? onDragEnterCapture? onDragExit? onDragExitCapture? onDragLeave? onDragLeaveCapture? onDragOver? onDragOverCapture? onDragStartCapture? onDrop? onDropCapture? onDurationChange? onDurationChangeCapture? onEmptied? onEmptiedCapture? onEncrypted? onEncryptedCapture? onEnded? onEndedCapture? onError? onErrorCapture? onFinish? onFocus? onFocusCapture? onGotPointerCapture? onGotPointerCaptureCapture? onInput? onInputCapture? onInvalid? onInvalidCapture? onKeyDown? onKeyDownCapture? onKeyPress? onKeyPressCapture? onKeyUp? onKeyUpCapture? onLoad? onLoadCapture? onLoadStart? onLoadStartCapture? onLoadedData? onLoadedDataCapture? onLoadedMetadata? onLoadedMetadataCapture? onLostPointerCapture? onLostPointerCaptureCapture? onMeasureDragConstraints? onMouseDown? onMouseDownCapture? onMouseEnter? onMouseLeave? onMouseMove? onMouseMoveCapture? onMouseOut? onMouseOutCapture? onMouseOver? onMouseOverCapture? onMouseUp? onMouseUpCapture? onPaste? onPasteCapture? onPause? onPauseCapture? onPlay? onPlayCapture? onPlaying? onPlayingCapture? onPointerCancel? onPointerCancelCapture? onPointerDown? onPointerDownCapture? onPointerEnter? onPointerEnterCapture? onPointerLeave? onPointerLeaveCapture? onPointerMove? onPointerMoveCapture? onPointerOut? onPointerOutCapture? onPointerOver? onPointerOverCapture? onPointerUp? onPointerUpCapture? onProgress? onProgressCapture? onRateChange? onRateChangeCapture? onReset? onResetCapture? onResize? onResizeCapture? onScroll? onScrollCapture? onSeeked? onSeekedCapture? onSeeking? onSeekingCapture? onSelect? onSelectCapture? onStalled? onStalledCapture? onSubmit? onSubmitCapture? onSuspend? onSuspendCapture? onTimeUpdate? onTimeUpdateCapture? onTouchCancel? onTouchCancelCapture? onTouchEnd? onTouchEndCapture? onTouchMove? onTouchMoveCapture? onTouchStart? onTouchStartCapture? onTransitionEnd? onTransitionEndCapture? onViewportEnter? onViewportLeave? onVolumeChange? onVolumeChangeCapture? onWaiting? onWaitingCapture? onWheel? onWheelCapture? prefix? prefixCls? property? radioGroup? rel? resource? results? rev? role? security? slot? spellCheck? style? suppressContentEditableWarning? suppressHydrationWarning? tabIndex? title? transition? translate? tw? typeof? unselectable? variants? viewport? vocab? whileDrag? whileFocus? whileHover? whileInView? whileTap? wrap?

Methods

Properties

_dragX?: MotionValue<number>

Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement. Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values. This allows you to manually control how updates from a drag gesture on an element is applied.

_dragY?: MotionValue<number>

Usually, dragging uses the layout project engine, and applies transforms to the underlying VisualElement. Passing MotionValues as _dragX and _dragY instead applies drag updates to these motion values. This allows you to manually control how updates from a drag gesture on an element is applied.

about?: string
accessKey?: string
align?: ResponsiveValue<undefined | "top" | "bottom" | "middle" | "stretch" | ResponsiveAligns>

Values to animate to, variant label(s), or AnimationControls.

// As values
<motion.div animate={{ opacity: 1 }} />

// As variant
<motion.div animate="visible" variants={variants} />

// Multiple variants
<motion.div animate={["visible", "active"]} variants={variants} />

// AnimationControls
<motion.div animate={animation} />
aria-activedescendant?: string

Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.

aria-atomic?: Booleanish

Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.

aria-autocomplete?: "none" | "inline" | "both" | "list"

Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.

aria-braillelabel?: string

Defines a string value that labels the current element, which is intended to be converted into Braille.

See

aria-label.

aria-brailleroledescription?: string

Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.

See

aria-roledescription.

aria-busy?: Booleanish
aria-checked?: boolean | "true" | "false" | "mixed"

Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.

See

  • aria-pressed
  • aria-selected.
aria-colcount?: number

Defines the total number of columns in a table, grid, or treegrid.

See

aria-colindex.

aria-colindex?: number

Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.

See

  • aria-colcount
  • aria-colspan.
aria-colindextext?: string

Defines a human readable text alternative of aria-colindex.

See

aria-rowindextext.

aria-colspan?: number

Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.

See

  • aria-colindex
  • aria-rowspan.
aria-controls?: string

Identifies the element (or elements) whose contents or presence are controlled by the current element.

See

aria-owns.

aria-current?: boolean | "date" | "time" | "true" | "false" | "page" | "step" | "location"

Indicates the element that represents the current item within a container or set of related elements.

aria-describedby?: string

Identifies the element (or elements) that describes the object.

See

aria-labelledby

aria-description?: string

Defines a string value that describes or annotates the current element.

See

related aria-describedby.

aria-details?: string

Identifies the element that provides a detailed, extended description for the object.

See

aria-describedby.

aria-disabled?: Booleanish

Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.

See

  • aria-hidden
  • aria-readonly.
aria-dropeffect?: "link" | "copy" | "none" | "move" | "execute" | "popup"

Indicates what functions can be performed when a dragged object is released on the drop target.

Deprecated

in ARIA 1.1

aria-errormessage?: string

Identifies the element that provides an error message for the object.

See

  • aria-invalid
  • aria-describedby.
aria-expanded?: Booleanish

Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.

aria-flowto?: string

Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.

aria-grabbed?: Booleanish

Indicates an element's "grabbed" state in a drag-and-drop operation.

Deprecated

in ARIA 1.1

aria-haspopup?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree"

Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.

aria-hidden?: Booleanish

Indicates whether the element is exposed to an accessibility API.

See

aria-disabled.

aria-invalid?: boolean | "true" | "false" | "grammar" | "spelling"

Indicates the entered value does not conform to the format expected by the application.

See

aria-errormessage.

aria-keyshortcuts?: string

Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.

aria-label?: string

Defines a string value that labels the current element.

See

aria-labelledby.

aria-labelledby?: string

Identifies the element (or elements) that labels the current element.

See

aria-describedby.

aria-level?: number

Defines the hierarchical level of an element within a structure.

aria-live?: "off" | "assertive" | "polite"

Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.

aria-modal?: Booleanish

Indicates whether an element is modal when displayed.

aria-multiline?: Booleanish

Indicates whether a text box accepts multiple lines of input or only a single line.

aria-multiselectable?: Booleanish

Indicates that the user may select more than one item from the current selectable descendants.

aria-orientation?: "horizontal" | "vertical"

Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.

aria-owns?: string

Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.

See

aria-controls.

aria-placeholder?: string

Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.

aria-posinset?: number

Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.

See

aria-setsize.

aria-pressed?: boolean | "true" | "false" | "mixed"

Indicates the current "pressed" state of toggle buttons.

See

  • aria-checked
  • aria-selected.
aria-readonly?: Booleanish

Indicates that the element is not editable, but is otherwise operable.

See

aria-disabled.

aria-relevant?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals"

Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.

See

aria-atomic.

aria-required?: Booleanish

Indicates that user input is required on the element before a form may be submitted.

aria-roledescription?: string

Defines a human-readable, author-localized description for the role of an element.

aria-rowcount?: number

Defines the total number of rows in a table, grid, or treegrid.

See

aria-rowindex.

aria-rowindex?: number

Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.

See

  • aria-rowcount
  • aria-rowspan.
aria-rowindextext?: string

Defines a human readable text alternative of aria-rowindex.

See

aria-colindextext.

aria-rowspan?: number

Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.

See

  • aria-rowindex
  • aria-colspan.
aria-selected?: Booleanish

Indicates the current "selected" state of various widgets.

See

  • aria-checked
  • aria-pressed.
aria-setsize?: number

Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.

See

aria-posinset.

aria-sort?: "none" | "ascending" | "descending" | "other"

Indicates if items in a table or grid are sorted in ascending or descending order.

aria-valuemax?: number

Defines the maximum allowed value for a range widget.

aria-valuemin?: number

Defines the minimum allowed value for a range widget.

aria-valuenow?: number

Defines the current value for a range widget.

See

aria-valuetext.

aria-valuetext?: string

Defines the human readable text alternative of aria-valuenow for a range widget.

autoCapitalize?: string
autoCorrect?: string
autoFocus?: boolean
autoSave?: string
children?: ReactNode | MotionValue<number> | MotionValue<string>
className?: string
colon?: boolean
color?: string
content?: string
contentEditable?: "inherit" | Booleanish | "plaintext-only"
contextMenu?: string
custom?: any

Custom data to use to resolve dynamic variants differently for each animating component.

const variants = {
visible: (custom) => ({
opacity: 1,
transition: { delay: custom * 0.2 }
})
}

<motion.div custom={0} animate="visible" variants={variants} />
<motion.div custom={1} animate="visible" variants={variants} />
<motion.div custom={2} animate="visible" variants={variants} />
dangerouslySetInnerHTML?: {
    __html: string | TrustedHTML;
}

Type declaration

  • __html: string | TrustedHTML
datatype?: string
defaultChecked?: boolean
defaultValue?: string | number | readonly string[]
dir?: string
drag?: boolean | "x" | "y"

Enable dragging for this element. Set to false by default. Set true to drag in both directions. Set "x" or "y" to only drag in a specific direction.

<motion.div drag="x" />
dragConstraints?: false | Partial<BoundingBox> | RefObject<Element>

Applies constraints on the permitted draggable area.

It can accept an object of optional top, left, right, and bottom values, measured in pixels. This will define a distance the named edge of the draggable component.

Alternatively, it can accept a ref to another component created with React's useRef hook. This ref should be passed both to the draggable component's dragConstraints prop, and the ref of the component you want to use as constraints.

// In pixels
<motion.div
drag="x"
dragConstraints={{ left: 0, right: 300 }}
/>

// As a ref to another component
const MyComponent = () => {
const constraintsRef = useRef(null)

return (
<motion.div ref={constraintsRef}>
<motion.div drag dragConstraints={constraintsRef} />
</motion.div>
)
}
dragControls?: DragControls

Usually, dragging is initiated by pressing down on a component and moving it. For some use-cases, for instance clicking at an arbitrary point on a video scrubber, we might want to initiate dragging from a different component than the draggable one.

By creating a dragControls using the useDragControls hook, we can pass this into the draggable component's dragControls prop. It exposes a start method that can start dragging from pointer events on other components.

const dragControls = useDragControls()

function startDrag(event) {
dragControls.start(event, { snapToCursor: true })
}

return (
<>
<div onPointerDown={startDrag} />
<motion.div drag="x" dragControls={dragControls} />
</>
)
dragDirectionLock?: boolean

If true, this will lock dragging to the initially-detected direction. Defaults to false.

<motion.div drag dragDirectionLock />
dragElastic?: DragElastic

The degree of movement allowed outside constraints. 0 = no movement, 1 = full movement.

Set to 0.5 by default. Can also be set as false to disable movement.

By passing an object of top/right/bottom/left, individual values can be set per constraint. Any missing values will be set to 0.

<motion.div
drag
dragConstraints={{ left: 0, right: 300 }}
dragElastic={0.2}
/>
dragListener?: boolean

By default, if drag is defined on a component then an event listener will be attached to automatically initiate dragging when a user presses down on it.

By setting dragListener to false, this event listener will not be created.

const dragControls = useDragControls()

function startDrag(event) {
dragControls.start(event, { snapToCursor: true })
}

return (
<>
<div onPointerDown={startDrag} />
<motion.div
drag="x"
dragControls={dragControls}
dragListener={false}
/>
</>
)
dragMomentum?: boolean

Apply momentum from the pan gesture to the component when dragging finishes. Set to true by default.

<motion.div
drag
dragConstraints={{ left: 0, right: 300 }}
dragMomentum={false}
/>
dragPropagation?: boolean

Allows drag gesture propagation to child components. Set to false by default.

<motion.div drag="x" dragPropagation />
dragSnapToOrigin?: boolean

If true, element will snap back to its origin when dragging ends.

Enabling this is the equivalent of setting all dragConstraints axes to 0 with dragElastic={1}, but when used together dragConstraints can define a wider draggable area and dragSnapToOrigin will ensure the element animates back to its origin on release.

dragTransition?: Partial<Omit<Inertia, "type" | "velocity">>

Allows you to change dragging inertia parameters. When releasing a draggable Frame, an animation with type inertia starts. The animation is based on your dragging velocity. This property allows you to customize it. See Inertia for all properties you can use.

<motion.div
drag
dragTransition={{ bounceStiffness: 600, bounceDamping: 10 }}
/>
draggable?: Booleanish

A target to animate to when this component is removed from the tree.

This component must be the first animatable child of an AnimatePresence to enable this exit animation.

This limitation exists because React doesn't allow components to defer unmounting until after an animation is complete. Once this limitation is fixed, the AnimatePresence component will be unnecessary.

import { AnimatePresence, motion } from 'framer-motion'

export const MyComponent = ({ isVisible }) => {
return (
<AnimatePresence>
{isVisible && (
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
/>
)}
</AnimatePresence>
)
}
finishingDisabled?: boolean
form?: Omit<FormProps<Record<string, any>>, "colon" | "lazy" | "initialValues" | "onFinish" | "finishingDisabled" | "interactiveInitialValues">
globalTapTarget?: boolean

If true, the tap gesture will attach its start listener to window.

Note: This is not supported publically.

gutter?: ResponsiveValue<Gutter | [Gutter, Gutter]>
hidden?: boolean
id?: string
ignoreStrict?: boolean

Set to false to prevent throwing an error when a motion component is used within a LazyMotion set to strict.

inherit?: boolean

Set to false to prevent inheriting variant changes from its parent.

initial?: boolean | MakeCustomValueType<TargetProperties> | VariantLabels

Properties, variant label or array of variant labels to start in.

Set to false to initialise with the values in animate (disabling the mount animation)

// As values
<motion.div initial={{ opacity: 1 }} />

// As variant
<motion.div initial="visible" variants={variants} />

// Multiple variants
<motion.div initial={["visible", "active"]} variants={variants} />

// As false (disable mount animation)
<motion.div initial={false} animate={{ opacity: 0 }} />
initialValues?: Record<string, any>
inlist?: any
inputMode?: "search" | "text" | "email" | "url" | "none" | "tel" | "numeric" | "decimal"

Hints at the type of data that might be entered by the user while editing the element or its contents

interactiveInitialValues?: boolean
is?: string

Specify that a standard HTML element should behave like a defined custom built-in element

itemID?: string
itemProp?: string
itemRef?: string
itemScope?: boolean
itemType?: string
justify?: ResponsiveValue<undefined | "center" | "end" | "start" | "space-around" | "space-between" | "space-evenly" | ResponsiveJustify>
lang?: string
layout?: boolean | "size" | "position" | "preserve-aspect"

If true, this component will automatically animate to its new position when its layout changes.

<motion.div layout />

This will perform a layout animation using performant transforms. Part of this technique involved animating an element's scale. This can introduce visual distortions on children, boxShadow and borderRadius.

To correct distortion on immediate children, add layout to those too.

boxShadow and borderRadius will automatically be corrected if they are already being animated on this component. Otherwise, set them directly via the initial prop.

If layout is set to "position", the size of the component will change instantly and only its position will animate. If layout is set to "size", the position of the component will change instantly but its size will animate.

If layout is set to "size", the position of the component will change instantly and only its size will animate.

If layout is set to "preserve-aspect", the component will animate size & position if the aspect ratio remains the same between renders, and just position if the ratio changes.

layoutDependency?: any
layoutId?: string

Enable shared layout transitions between different components with the same layoutId.

When a component with a layoutId is removed from the React tree, and then added elsewhere, it will visually animate from the previous component's bounding box and its latest animated values.

  {items.map(item => (
<motion.li layout>
{item.name}
{item.isSelected && <motion.div layoutId="underline" />}
</motion.li>
))}

If the previous component remains in the tree it will crossfade with the new component.

layoutRoot?: boolean

Whether an element should be considered a "layout root", where all children will be forced to resolve relatively to it. Currently used for position: sticky elements in Framer.

layoutScroll?: boolean

Whether a projection node should measure its scroll when it or its descendants update their layout.

lazy?: true
nonce?: string
onAbort?: ReactEventHandler<HTMLDivElement>
onAbortCapture?: ReactEventHandler<HTMLDivElement>
onAnimationEnd?: AnimationEventHandler<HTMLDivElement>
onAnimationEndCapture?: AnimationEventHandler<HTMLDivElement>
onAnimationIteration?: AnimationEventHandler<HTMLDivElement>
onAnimationIterationCapture?: AnimationEventHandler<HTMLDivElement>
onAnimationStartCapture?: AnimationEventHandler<HTMLDivElement>
onAuxClick?: MouseEventHandler<HTMLDivElement>
onAuxClickCapture?: MouseEventHandler<HTMLDivElement>
onBeforeInput?: FormEventHandler<HTMLDivElement>
onBeforeInputCapture?: FormEventHandler<HTMLDivElement>
onBlur?: FocusEventHandler<HTMLDivElement>
onBlurCapture?: FocusEventHandler<HTMLDivElement>
onCanPlay?: ReactEventHandler<HTMLDivElement>
onCanPlayCapture?: ReactEventHandler<HTMLDivElement>
onCanPlayThrough?: ReactEventHandler<HTMLDivElement>
onCanPlayThroughCapture?: ReactEventHandler<HTMLDivElement>
onChange?: FormEventHandler<HTMLDivElement>
onChangeCapture?: FormEventHandler<HTMLDivElement>
onClick?: MouseEventHandler<HTMLDivElement>
onClickCapture?: MouseEventHandler<HTMLDivElement>
onCompositionEnd?: CompositionEventHandler<HTMLDivElement>
onCompositionEndCapture?: CompositionEventHandler<HTMLDivElement>
onCompositionStart?: CompositionEventHandler<HTMLDivElement>
onCompositionStartCapture?: CompositionEventHandler<HTMLDivElement>
onCompositionUpdate?: CompositionEventHandler<HTMLDivElement>
onCompositionUpdateCapture?: CompositionEventHandler<HTMLDivElement>
onContextMenu?: MouseEventHandler<HTMLDivElement>
onContextMenuCapture?: MouseEventHandler<HTMLDivElement>
onCopy?: ClipboardEventHandler<HTMLDivElement>
onCopyCapture?: ClipboardEventHandler<HTMLDivElement>
onCut?: ClipboardEventHandler<HTMLDivElement>
onCutCapture?: ClipboardEventHandler<HTMLDivElement>
onDoubleClick?: MouseEventHandler<HTMLDivElement>
onDoubleClickCapture?: MouseEventHandler<HTMLDivElement>
onDragCapture?: DragEventHandler<HTMLDivElement>
onDragEndCapture?: DragEventHandler<HTMLDivElement>
onDragEnter?: DragEventHandler<HTMLDivElement>
onDragEnterCapture?: DragEventHandler<HTMLDivElement>
onDragExit?: DragEventHandler<HTMLDivElement>
onDragExitCapture?: DragEventHandler<HTMLDivElement>
onDragLeave?: DragEventHandler<HTMLDivElement>
onDragLeaveCapture?: DragEventHandler<HTMLDivElement>
onDragOver?: DragEventHandler<HTMLDivElement>
onDragOverCapture?: DragEventHandler<HTMLDivElement>
onDragStartCapture?: DragEventHandler<HTMLDivElement>
onDrop?: DragEventHandler<HTMLDivElement>
onDropCapture?: DragEventHandler<HTMLDivElement>
onDurationChange?: ReactEventHandler<HTMLDivElement>
onDurationChangeCapture?: ReactEventHandler<HTMLDivElement>
onEmptied?: ReactEventHandler<HTMLDivElement>
onEmptiedCapture?: ReactEventHandler<HTMLDivElement>
onEncrypted?: ReactEventHandler<HTMLDivElement>
onEncryptedCapture?: ReactEventHandler<HTMLDivElement>
onEnded?: ReactEventHandler<HTMLDivElement>
onEndedCapture?: ReactEventHandler<HTMLDivElement>
onError?: ReactEventHandler<HTMLDivElement>
onErrorCapture?: ReactEventHandler<HTMLDivElement>
onFinish?: ((values) => void)

Type declaration

    • (values): void
    • Parameters

      Returns void

onFocus?: FocusEventHandler<HTMLDivElement>
onFocusCapture?: FocusEventHandler<HTMLDivElement>
onGotPointerCapture?: PointerEventHandler<HTMLDivElement>
onGotPointerCaptureCapture?: PointerEventHandler<HTMLDivElement>
onInput?: FormEventHandler<HTMLDivElement>
onInputCapture?: FormEventHandler<HTMLDivElement>
onInvalid?: FormEventHandler<HTMLDivElement>
onInvalidCapture?: FormEventHandler<HTMLDivElement>
onKeyDown?: KeyboardEventHandler<HTMLDivElement>
onKeyDownCapture?: KeyboardEventHandler<HTMLDivElement>
onKeyPress?: KeyboardEventHandler<HTMLDivElement>

Deprecated

onKeyPressCapture?: KeyboardEventHandler<HTMLDivElement>

Deprecated

onKeyUp?: KeyboardEventHandler<HTMLDivElement>
onKeyUpCapture?: KeyboardEventHandler<HTMLDivElement>
onLoad?: ReactEventHandler<HTMLDivElement>
onLoadCapture?: ReactEventHandler<HTMLDivElement>
onLoadStart?: ReactEventHandler<HTMLDivElement>
onLoadStartCapture?: ReactEventHandler<HTMLDivElement>
onLoadedData?: ReactEventHandler<HTMLDivElement>
onLoadedDataCapture?: ReactEventHandler<HTMLDivElement>
onLoadedMetadata?: ReactEventHandler<HTMLDivElement>
onLoadedMetadataCapture?: ReactEventHandler<HTMLDivElement>
onLostPointerCapture?: PointerEventHandler<HTMLDivElement>
onLostPointerCaptureCapture?: PointerEventHandler<HTMLDivElement>
onMeasureDragConstraints?: ((constraints) => void | BoundingBox)

If dragConstraints is set to a React ref, this callback will call with the measured drag constraints.

Type declaration

    • (constraints): void | BoundingBox
    • If dragConstraints is set to a React ref, this callback will call with the measured drag constraints.

      Parameters

      Returns void | BoundingBox

onMouseDown?: MouseEventHandler<HTMLDivElement>
onMouseDownCapture?: MouseEventHandler<HTMLDivElement>
onMouseEnter?: MouseEventHandler<HTMLDivElement>
onMouseLeave?: MouseEventHandler<HTMLDivElement>
onMouseMove?: MouseEventHandler<HTMLDivElement>
onMouseMoveCapture?: MouseEventHandler<HTMLDivElement>
onMouseOut?: MouseEventHandler<HTMLDivElement>
onMouseOutCapture?: MouseEventHandler<HTMLDivElement>
onMouseOver?: MouseEventHandler<HTMLDivElement>
onMouseOverCapture?: MouseEventHandler<HTMLDivElement>
onMouseUp?: MouseEventHandler<HTMLDivElement>
onMouseUpCapture?: MouseEventHandler<HTMLDivElement>
onPaste?: ClipboardEventHandler<HTMLDivElement>
onPasteCapture?: ClipboardEventHandler<HTMLDivElement>
onPause?: ReactEventHandler<HTMLDivElement>
onPauseCapture?: ReactEventHandler<HTMLDivElement>
onPlay?: ReactEventHandler<HTMLDivElement>
onPlayCapture?: ReactEventHandler<HTMLDivElement>
onPlaying?: ReactEventHandler<HTMLDivElement>
onPlayingCapture?: ReactEventHandler<HTMLDivElement>
onPointerCancel?: PointerEventHandler<HTMLDivElement>
onPointerCancelCapture?: PointerEventHandler<HTMLDivElement>
onPointerDown?: PointerEventHandler<HTMLDivElement>
onPointerDownCapture?: PointerEventHandler<HTMLDivElement>
onPointerEnter?: PointerEventHandler<HTMLDivElement>
onPointerEnterCapture?: PointerEventHandler<HTMLDivElement>
onPointerLeave?: PointerEventHandler<HTMLDivElement>
onPointerLeaveCapture?: PointerEventHandler<HTMLDivElement>
onPointerMove?: PointerEventHandler<HTMLDivElement>
onPointerMoveCapture?: PointerEventHandler<HTMLDivElement>
onPointerOut?: PointerEventHandler<HTMLDivElement>
onPointerOutCapture?: PointerEventHandler<HTMLDivElement>
onPointerOver?: PointerEventHandler<HTMLDivElement>
onPointerOverCapture?: PointerEventHandler<HTMLDivElement>
onPointerUp?: PointerEventHandler<HTMLDivElement>
onPointerUpCapture?: PointerEventHandler<HTMLDivElement>
onProgress?: ReactEventHandler<HTMLDivElement>
onProgressCapture?: ReactEventHandler<HTMLDivElement>
onRateChange?: ReactEventHandler<HTMLDivElement>
onRateChangeCapture?: ReactEventHandler<HTMLDivElement>
onReset?: FormEventHandler<HTMLDivElement>
onResetCapture?: FormEventHandler<HTMLDivElement>
onResize?: ReactEventHandler<HTMLDivElement>
onResizeCapture?: ReactEventHandler<HTMLDivElement>
onScroll?: UIEventHandler<HTMLDivElement>
onScrollCapture?: UIEventHandler<HTMLDivElement>
onSeeked?: ReactEventHandler<HTMLDivElement>
onSeekedCapture?: ReactEventHandler<HTMLDivElement>
onSeeking?: ReactEventHandler<HTMLDivElement>
onSeekingCapture?: ReactEventHandler<HTMLDivElement>
onSelect?: ReactEventHandler<HTMLDivElement>
onSelectCapture?: ReactEventHandler<HTMLDivElement>
onStalled?: ReactEventHandler<HTMLDivElement>
onStalledCapture?: ReactEventHandler<HTMLDivElement>
onSubmit?: FormEventHandler<HTMLDivElement>
onSubmitCapture?: FormEventHandler<HTMLDivElement>
onSuspend?: ReactEventHandler<HTMLDivElement>
onSuspendCapture?: ReactEventHandler<HTMLDivElement>
onTimeUpdate?: ReactEventHandler<HTMLDivElement>
onTimeUpdateCapture?: ReactEventHandler<HTMLDivElement>
onTouchCancel?: TouchEventHandler<HTMLDivElement>
onTouchCancelCapture?: TouchEventHandler<HTMLDivElement>
onTouchEnd?: TouchEventHandler<HTMLDivElement>
onTouchEndCapture?: TouchEventHandler<HTMLDivElement>
onTouchMove?: TouchEventHandler<HTMLDivElement>
onTouchMoveCapture?: TouchEventHandler<HTMLDivElement>
onTouchStart?: TouchEventHandler<HTMLDivElement>
onTouchStartCapture?: TouchEventHandler<HTMLDivElement>
onTransitionEnd?: TransitionEventHandler<HTMLDivElement>
onTransitionEndCapture?: TransitionEventHandler<HTMLDivElement>
onViewportEnter?: ViewportEventHandler
onViewportLeave?: ViewportEventHandler
onVolumeChange?: ReactEventHandler<HTMLDivElement>
onVolumeChangeCapture?: ReactEventHandler<HTMLDivElement>
onWaiting?: ReactEventHandler<HTMLDivElement>
onWaitingCapture?: ReactEventHandler<HTMLDivElement>
onWheel?: WheelEventHandler<HTMLDivElement>
onWheelCapture?: WheelEventHandler<HTMLDivElement>
prefix?: string
prefixCls?: string
property?: string
radioGroup?: string
rel?: string
resource?: string
results?: number
rev?: string
role?: AriaRole
security?: string
slot?: string
spellCheck?: Booleanish
style?: MotionStyle

The React DOM style prop, enhanced with support for MotionValues and separate transform values.

export const MyComponent = () => {
const x = useMotionValue(0)

return <motion.div style={{ x, opacity: 1, scale: 0.5 }} />
}
suppressContentEditableWarning?: boolean
suppressHydrationWarning?: boolean
tabIndex?: number
title?: string
transition?: Transition

Default transition. If no transition is defined in animate, it will use the transition defined here.

const spring = {
type: "spring",
damping: 10,
stiffness: 100
}

<motion.div transition={spring} animate={{ scale: 1.2 }} />
translate?: "no" | "yes"
tw?: string

Specify styles using Tailwind CSS classes. This feature is currently experimental. If style prop is also specified, styles generated with tw prop will be overridden.

Example:

  • tw='w-full h-full bg-blue-200'
  • tw='text-9xl'
  • tw='text-[80px]'
typeof?: string
unselectable?: "on" | "off"
variants?: Variants

Variants allow you to define animation states and organise them by name. They allow you to control animations throughout a component tree by switching a single animate prop.

Using transition options like delayChildren and staggerChildren, you can orchestrate when children animations play relative to their parent.

After passing variants to one or more motion component's variants prop, these variants can be used in place of values on the animate, initial, whileFocus, whileTap and whileHover props.

const variants = {
active: {
backgroundColor: "#f00"
},
inactive: {
backgroundColor: "#fff",
transition: { duration: 2 }
}
}

<motion.div variants={variants} animate="active" />
viewport?: ViewportOptions
vocab?: string

Properties or variant label to animate to while the drag gesture is recognised.

<motion.div whileDrag={{ scale: 1.2 }} />

Properties or variant label to animate to while the focus gesture is recognised.

<motion.input whileFocus={{ scale: 1.2 }} />

Properties or variant label to animate to while the hover gesture is recognised.

<motion.div whileHover={{ scale: 1.2 }} />

Properties or variant label to animate to while the component is pressed.

<motion.div whileTap={{ scale: 0.8 }} />
wrap?: boolean

Methods

  • Callback when animation defined in animate is complete.

    The provided callback will be called with the triggering animation definition. If this is a variant, it'll be the variant name, and if a target object then it'll be the target object.

    This way, it's possible to figure out which animation has completed.

    function onComplete() {
    console.log("Animation completed")
    }

    <motion.div
    animate={{ x: 100 }}
    onAnimationComplete={definition => {
    console.log('Completed animating', definition)
    }}
    />

    Parameters

    Returns void

  • Callback when animation defined in animate begins.

    The provided callback will be called with the triggering animation definition. If this is a variant, it'll be the variant name, and if a target object then it'll be the target object.

    This way, it's possible to figure out which animation has started.

    function onStart() {
    console.log("Animation started")
    }

    <motion.div animate={{ x: 100 }} onAnimationStart={onStart} />

    Parameters

    Returns void

  • Parameters

    Returns void

  • Callback function that fires a drag direction is determined.

    <motion.div
    drag
    dragDirectionLock
    onDirectionLock={axis => console.log(axis)}
    />

    Parameters

    • axis: "x" | "y"

    Returns void

  • Callback function that fires when the component is dragged.

    <motion.div
    drag
    onDrag={
    (event, info) => console.log(info.point.x, info.point.y)
    }
    />

    Parameters

    Returns void

  • Callback function that fires when dragging ends.

    <motion.div
    drag
    onDragEnd={
    (event, info) => console.log(info.point.x, info.point.y)
    }
    />

    Parameters

    Returns void

  • Callback function that fires when dragging starts.

    <motion.div
    drag
    onDragStart={
    (event, info) => console.log(info.point.x, info.point.y)
    }
    />

    Parameters

    Returns void

  • Callback function that fires when drag momentum/bounce transition finishes.

    <motion.div
    drag
    onDragTransitionEnd={() => console.log('Drag transition complete')}
    />

    Returns void

  • Callback function that fires when pointer stops hovering over the component.

    <motion.div onHoverEnd={() => console.log("Hover ends")} />
    

    Parameters

    Returns void

  • Callback function that fires when pointer starts hovering over the component.

    <motion.div onHoverStart={() => console.log('Hover starts')} />
    

    Parameters

    Returns void

  • A callback that will fire when a layout animation on this component completes.

    Returns void

  • A callback that will fire when a layout animation on this component starts.

    Returns void

  • Parameters

    Returns void

  • Callback function that fires when the pan gesture is recognised on this element.

    Note: For pan gestures to work correctly with touch input, the element needs touch scrolling to be disabled on either x/y or both axis with the touch-action CSS rule.

    function onPan(event, info) {
    console.log(info.point.x, info.point.y)
    }

    <motion.div onPan={onPan} />

    Parameters

    • event: PointerEvent

      The originating pointer event.

    • info: PanInfo

      A PanInfo object containing x and y values for:

      • point: Relative to the device or page.
      • delta: Distance moved since the last event.
      • offset: Offset from the original pan event.
      • velocity: Current velocity of the pointer.

    Returns void

  • Callback function that fires when the pan gesture ends on this element.

    function onPanEnd(event, info) {
    console.log(info.point.x, info.point.y)
    }

    <motion.div onPanEnd={onPanEnd} />

    Parameters

    • event: PointerEvent

      The originating pointer event.

    • info: PanInfo

      A PanInfo object containing x/y values for:

      • point: Relative to the device or page.
      • delta: Distance moved since the last event.
      • offset: Offset from the original pan event.
      • velocity: Current velocity of the pointer.

    Returns void

  • Callback function that fires when we begin detecting a pan gesture. This is analogous to onMouseStart or onTouchStart.

    function onPanSessionStart(event, info) {
    console.log(info.point.x, info.point.y)
    }

    <motion.div onPanSessionStart={onPanSessionStart} />

    Parameters

    • event: PointerEvent

      The originating pointer event.

    • info: EventInfo

      An EventInfo object containing x/y values for:

      • point: Relative to the device or page.

    Returns void

  • Callback function that fires when the pan gesture begins on this element.

    function onPanStart(event, info) {
    console.log(info.point.x, info.point.y)
    }

    <motion.div onPanStart={onPanStart} />

    Parameters

    • event: PointerEvent

      The originating pointer event.

    • info: PanInfo

      A PanInfo object containing x/y values for:

      • point: Relative to the device or page.
      • delta: Distance moved since the last event.
      • offset: Offset from the original pan event.
      • velocity: Current velocity of the pointer.

    Returns void

  • Callback when the tap gesture successfully ends on this element.

    function onTap(event, info) {
    console.log(info.point.x, info.point.y)
    }

    <motion.div onTap={onTap} />

    Parameters

    Returns void

  • Callback when the tap gesture ends outside this element.

    function onTapCancel(event, info) {
    console.log(info.point.x, info.point.y)
    }

    <motion.div onTapCancel={onTapCancel} />

    Parameters

    Returns void

  • Callback when the tap gesture starts on this element.

    function onTapStart(event, info) {
    console.log(info.point.x, info.point.y)
    }

    <motion.div onTapStart={onTapStart} />

    Parameters

    Returns void

  • Callback with latest motion values, fired max once per frame.

    function onUpdate(latest) {
    console.log(latest.x, latest.opacity)
    }

    <motion.div animate={{ x: 100, opacity: 0 }} onUpdate={onUpdate} />

    Parameters

    Returns void

  • By default, Framer Motion generates a transform property with a sensible transform order. transformTemplate can be used to create a different order, or to append/preprend the automatically generated transform property.

    <motion.div
    style={{ x: 0, rotate: 180 }}
    transformTemplate={
    ({ x, rotate }) => `rotate(${rotate}deg) translateX(${x}px)`
    }
    />

    Parameters

    • transform: TransformProperties

      The latest animated transform props.

    • generatedTransform: string

      The transform string as automatically generated by Framer Motion

    Returns string

Generated using TypeDoc