= {
readonly $$typeof: symbol;
} & ((props: PropsWithoutRef & RefAttributes) => JSX.Element);
/**
* Support for React component props
*/
type UnwrapFactoryAttributes = F extends DetailedHTMLFactory ? P : never;
type UnwrapFactoryElement = F extends DetailedHTMLFactory ? P : never;
type HTMLAttributesWithoutMotionProps, Element extends HTMLElement> = {
[K in Exclude]?: Attributes[K];
};
/**
* @public
*/
type HTMLMotionProps = HTMLAttributesWithoutMotionProps, UnwrapFactoryElement> & MotionProps;
/**
* Motion-optimised versions of React's HTML components.
*
* @public
*/
type HTMLMotionComponents = {
[K in HTMLElements]: ForwardRefComponent, HTMLMotionProps>;
};
interface SVGAttributesWithoutMotionProps extends Pick, Exclude, keyof MotionProps>> {
}
/**
* Blanket-accept any SVG attribute as a `MotionValue`
* @public
*/
type SVGAttributesAsMotionValues = MakeMotion>;
type UnwrapSVGFactoryElement = F extends React.SVGProps ? P : never;
/**
* @public
*/
interface SVGMotionProps extends SVGAttributesAsMotionValues, MotionProps {
}
/**
* Motion-optimised versions of React's SVG components.
*
* @public
*/
type SVGMotionComponents = {
[K in SVGElements]: ForwardRefComponent, SVGMotionProps>>;
};
declare abstract class Feature {
isMounted: boolean;
node: VisualElement;
constructor(node: VisualElement);
abstract mount(): void;
abstract unmount(): void;
update(): void;
}
declare function MeasureLayout(props: MotionProps & {
visualElement: VisualElement;
}): react_jsx_runtime.JSX.Element;
interface FeatureClass {
new (props: Props): Feature;
}
type HydratedFeatureDefinition = {
isEnabled: (props: MotionProps) => boolean;
Feature: FeatureClass;
ProjectionNode?: any;
MeasureLayout?: typeof MeasureLayout;
};
interface HydratedFeatureDefinitions {
animation?: HydratedFeatureDefinition;
exit?: HydratedFeatureDefinition;
drag?: HydratedFeatureDefinition;
tap?: HydratedFeatureDefinition;
focus?: HydratedFeatureDefinition;
hover?: HydratedFeatureDefinition;
pan?: HydratedFeatureDefinition;
inView?: HydratedFeatureDefinition;
layout?: HydratedFeatureDefinition;
}
type FeatureDefinition = {
isEnabled: HydratedFeatureDefinition["isEnabled"];
Feature?: HydratedFeatureDefinition["Feature"];
ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"];
MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"];
};
type FeatureDefinitions = {
[K in keyof HydratedFeatureDefinitions]: FeatureDefinition;
};
type FeaturePackage = {
Feature?: HydratedFeatureDefinition["Feature"];
ProjectionNode?: HydratedFeatureDefinition["ProjectionNode"];
MeasureLayout?: HydratedFeatureDefinition["MeasureLayout"];
};
type FeaturePackages = {
[K in keyof HydratedFeatureDefinitions]: FeaturePackage;
};
interface FeatureBundle extends FeaturePackages {
renderer: CreateVisualElement;
}
type LazyFeatureBundle$1 = () => Promise;
type RenderComponent = (Component: string | react.ComponentType>, props: MotionProps, ref: react.Ref, visualState: VisualState, isStatic: boolean, visualElement?: VisualElement) => any;
interface MotionComponentConfig {
preloadedFeatures?: FeatureBundle;
createVisualElement?: CreateVisualElement;
useRender: RenderComponent;
useVisualState: UseVisualState;
Component: string | react.ComponentType>;
}
/**
* Create a `motion` component.
*
* This function accepts a Component argument, which can be either a string (ie "div"
* for `motion.div`), or an actual React component.
*
* Alongside this is a config option which provides a way of rendering the provided
* component "offline", or outside the React render cycle.
*/
declare function createMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component, }: MotionComponentConfig): react.ForwardRefExoticComponent & react.RefAttributes>;
/**
* I'd rather the return type of `custom` to be implicit but this throws
* incorrect relative paths in the exported types and API Extractor throws
* a wobbly.
*/
type CustomDomComponent = react.ForwardRefExoticComponent & react.RefAttributes>;
interface CustomMotionComponentConfig {
forwardMotionProps?: boolean;
}
interface DOMVisualElementOptions {
/**
* A function that can map a page point between spaces. Used by Framer
* to support dragging and layout animations within scaled space.
*
* @public
*/
transformPagePoint?: TransformPoint;
/**
* Allow `transform` to be set as `"none"` if all transforms are their default
* values. Switching to this removes the element as a GPU layer which can lead to subtle
* graphical shifts.
*
* @public
*/
allowTransformNone?: boolean;
/**
* If `true`, this element will be included in the projection tree.
*
* Default: `true`
*
* @public
*/
allowProjection?: boolean;
/**
* Allow this element to be GPU-accelerated. We currently enable this by
* adding a `translateZ(0)`.
*
* @public
*/
enableHardwareAcceleration?: boolean;
}
type DOMMotionComponents = HTMLMotionComponents & SVGMotionComponents;
/**
* HTML & SVG components, optimised for use with gestures and animation. These can be used as
* drop-in replacements for any HTML & SVG component, all CSS & SVG properties are supported.
*
* @public
*/
declare const motion: ((Component: string | react.ComponentType>, customMotionComponentConfig?: CustomMotionComponentConfig) => CustomDomComponent) & HTMLMotionComponents & SVGMotionComponents;
/**
* Create a DOM `motion` component with the provided string. This is primarily intended
* as a full alternative to `motion` for consumers who have to support environments that don't
* support `Proxy`.
*
* ```javascript
* import { createDomMotionComponent } from "framer-motion"
*
* const motion = {
* div: createDomMotionComponent('div')
* }
* ```
*
* @public
*/
declare function createDomMotionComponent(key: T): DOMMotionComponents[T];
/**
* @public
*/
declare const m: ((Component: string | react.ComponentType>, customMotionComponentConfig?: CustomMotionComponentConfig) => CustomDomComponent) & HTMLMotionComponents & SVGMotionComponents;
/**
* @public
*/
interface AnimatePresenceProps {
/**
* By passing `initial={false}`, `AnimatePresence` will disable any initial animations on children
* that are present when the component is first rendered.
*
* ```jsx
*
* {isVisible && (
*
* )}
*
* ```
*
* @public
*/
initial?: boolean;
/**
* When a component is removed, there's no longer a chance to update its props. So if a component's `exit`
* prop is defined as a dynamic variant and you want to pass a new `custom` prop, you can do so via `AnimatePresence`.
* This will ensure all leaving components animate using the latest data.
*
* @public
*/
custom?: any;
/**
* Fires when all exiting nodes have completed animating out.
*
* @public
*/
onExitComplete?: () => void;
/**
* Replace with `mode="wait"`
*
* @deprecated
*
* Replace with `mode="wait"`
*/
exitBeforeEnter?: boolean;
/**
* Determines how to handle entering and exiting elements.
*
* - `"sync"`: Default. Elements animate in and out as soon as they're added/removed.
* - `"popLayout"`: Exiting elements are "popped" from the page layout, allowing sibling
* elements to immediately occupy their new layouts.
* - `"wait"`: Only renders one component at a time. Wait for the exiting component to animate out
* before animating the next component in.
*
* @public
*/
mode?: "sync" | "popLayout" | "wait";
/**
* Internal. Used in Framer to flag that sibling children *shouldn't* re-render as a result of a
* child being removed.
*/
presenceAffectsLayout?: boolean;
}
/**
* `AnimatePresence` enables the animation of components that have been removed from the tree.
*
* When adding/removing more than a single child, every child **must** be given a unique `key` prop.
*
* Any `motion` components that have an `exit` property defined will animate out when removed from
* the tree.
*
* ```jsx
* import { motion, AnimatePresence } from 'framer-motion'
*
* export const Items = ({ items }) => (
*
* {items.map(item => (
*
* ))}
*
* )
* ```
*
* You can sequence exit animations throughout a tree using variants.
*
* If a child contains multiple `motion` components with `exit` props, it will only unmount the child
* once all `motion` components have finished animating out. Likewise, any components using
* `usePresence` all need to call `safeToRemove`.
*
* @public
*/
declare const AnimatePresence: react.FunctionComponent>;
type IsValidProp = (key: string) => boolean;
declare function filterProps(props: MotionProps, isDom: boolean, forwardMotionProps: boolean): MotionProps;
interface MotionConfigProps extends Partial {
children?: react.ReactNode;
isValidProp?: IsValidProp;
}
/**
* `MotionConfig` is used to set configuration options for all children `motion` components.
*
* ```jsx
* import { motion, MotionConfig } from "framer-motion"
*
* export function App() {
* return (
*
*
*
* )
* }
* ```
*
* @public
*/
declare function MotionConfig({ children, isValidProp, ...config }: MotionConfigProps): react_jsx_runtime.JSX.Element;
type LazyFeatureBundle = () => Promise;
/**
* @public
*/
interface LazyProps {
children?: React.ReactNode;
/**
* Can be used to provide a feature bundle synchronously or asynchronously.
*
* ```jsx
* // features.js
* import { domAnimation } from "framer-motion"
* export default domAnimation
*
* // index.js
* import { LazyMotion, m } from "framer-motion"
*
* const loadFeatures = import("./features.js")
* .then(res => res.default)
*
* function Component() {
* return (
*
*
*
* )
* }
* ```
*
* @public
*/
features: FeatureBundle | LazyFeatureBundle;
/**
* If `true`, will throw an error if a `motion` component renders within
* a `LazyMotion` component.
*
* ```jsx
* // This component will throw an error that explains using a motion component
* // instead of the m component will break the benefits of code-splitting.
* function Component() {
* return (
*
*
*
* )
* }
* ```
*
* @public
*/
strict?: boolean;
}
/**
* Used in conjunction with the `m` component to reduce bundle size.
*
* `m` is a version of the `motion` component that only loads functionality
* critical for the initial render.
*
* `LazyMotion` can then be used to either synchronously or asynchronously
* load animation and gesture support.
*
* ```jsx
* // Synchronous loading
* import { LazyMotion, m, domAnimation } from "framer-motion"
*
* function App() {
* return (
*
*
*
* )
* }
*
* // Asynchronous loading
* import { LazyMotion, m } from "framer-motion"
*
* function App() {
* return (
* import('./path/to/domAnimation')}>
*
*
* )
* }
* ```
*
* @public
*/
declare function LazyMotion({ children, features, strict }: LazyProps): react_jsx_runtime.JSX.Element;
type InheritOption = boolean | "id";
interface Props$2 {
id?: string;
inherit?: InheritOption;
}
declare const LayoutGroup: react.FunctionComponent>;
interface Props$1 {
/**
* A HTML element to render this component as. Defaults to `"li"`.
*
* @public
*/
as?: keyof ReactHTML;
/**
* The value in the list that this component represents.
*
* @public
*/
value: V;
/**
* A subset of layout options primarily used to disable layout="size"
*
* @public
* @default true
*/
layout?: true | "position";
}
interface Props {
/**
* A HTML element to render this component as. Defaults to `"ul"`.
*
* @public
*/
as?: keyof ReactHTML;
/**
* The axis to reorder along. By default, items will be draggable on this axis.
* To make draggable on both axes, set ``
*
* @public
*/
axis?: "x" | "y";
/**
* A callback to fire with the new value order. For instance, if the values
* are provided as a state from `useState`, this could be the set state function.
*
* @public
*/
onReorder: (newOrder: V[]) => void;
/**
* The latest values state.
*
* ```jsx
* function Component() {
* const [items, setItems] = useState([0, 1, 2])
*
* return (
*
* {items.map((item) => )}
*
* )
* }
* ```
*
* @public
*/
values: V[];
}
declare const Reorder: {
Group: (props: Props & Omit, "values"> & {
children?: react.ReactNode;
} & {
ref?: react.ForwardedRef | undefined;
}) => react_jsx_runtime.JSX.Element;
Item: (props: Props$1 & {
color?: string | undefined;
content?: string | undefined;
translate?: "no" | "yes" | undefined;
hidden?: boolean | undefined;
suppressHydrationWarning?: boolean | undefined;
className?: string | undefined;
id?: string | undefined;
lang?: string | undefined;
role?: react.AriaRole | undefined;
tabIndex?: number | undefined;
"aria-activedescendant"?: string | undefined;
"aria-atomic"?: (boolean | "false" | "true") | undefined;
"aria-autocomplete"?: "both" | "none" | "inline" | "list" | undefined;
"aria-braillelabel"?: string | undefined;
"aria-brailleroledescription"?: string | undefined;
"aria-busy"?: (boolean | "false" | "true") | undefined;
"aria-checked"?: boolean | "mixed" | "false" | "true" | undefined;
"aria-colcount"?: number | undefined;
"aria-colindex"?: number | undefined;
"aria-colindextext"?: string | undefined;
"aria-colspan"?: number | undefined;
"aria-controls"?: string | undefined;
"aria-current"?: boolean | "page" | "false" | "true" | "step" | "location" | "date" | "time" | undefined;
"aria-describedby"?: string | undefined;
"aria-description"?: string | undefined;
"aria-details"?: string | undefined;
"aria-disabled"?: (boolean | "false" | "true") | undefined;
"aria-dropeffect"?: "none" | "copy" | "move" | "link" | "execute" | "popup" | undefined;
"aria-errormessage"?: string | undefined;
"aria-expanded"?: (boolean | "false" | "true") | undefined;
"aria-flowto"?: string | undefined;
"aria-grabbed"?: (boolean | "false" | "true") | undefined;
"aria-haspopup"?: boolean | "grid" | "listbox" | "menu" | "false" | "true" | "dialog" | "tree" | undefined;
"aria-hidden"?: (boolean | "false" | "true") | undefined;
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
"aria-keyshortcuts"?: string | undefined;
"aria-label"?: string | undefined;
"aria-labelledby"?: string | undefined;
"aria-level"?: number | undefined;
"aria-live"?: "off" | "assertive" | "polite" | undefined;
"aria-modal"?: (boolean | "false" | "true") | undefined;
"aria-multiline"?: (boolean | "false" | "true") | undefined;
"aria-multiselectable"?: (boolean | "false" | "true") | undefined;
"aria-orientation"?: "horizontal" | "vertical" | undefined;
"aria-owns"?: string | undefined;
"aria-placeholder"?: string | undefined;
"aria-posinset"?: number | undefined;
"aria-pressed"?: boolean | "mixed" | "false" | "true" | undefined;
"aria-readonly"?: (boolean | "false" | "true") | undefined;
"aria-relevant"?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
"aria-required"?: (boolean | "false" | "true") | undefined;
"aria-roledescription"?: string | undefined;
"aria-rowcount"?: number | undefined;
"aria-rowindex"?: number | undefined;
"aria-rowindextext"?: string | undefined;
"aria-rowspan"?: number | undefined;
"aria-selected"?: (boolean | "false" | "true") | undefined;
"aria-setsize"?: number | undefined;
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
"aria-valuemax"?: number | undefined;
"aria-valuemin"?: number | undefined;
"aria-valuenow"?: number | undefined;
"aria-valuetext"?: string | undefined;
dangerouslySetInnerHTML?: {
__html: string | TrustedHTML;
} | undefined;
onCopy?: react.ClipboardEventHandler | undefined;
onCopyCapture?: react.ClipboardEventHandler | undefined;
onCut?: react.ClipboardEventHandler | undefined;
onCutCapture?: react.ClipboardEventHandler | undefined;
onPaste?: react.ClipboardEventHandler | undefined;
onPasteCapture?: react.ClipboardEventHandler | undefined;
onCompositionEnd?: react.CompositionEventHandler | undefined;
onCompositionEndCapture?: react.CompositionEventHandler | undefined;
onCompositionStart?: react.CompositionEventHandler | undefined;
onCompositionStartCapture?: react.CompositionEventHandler | undefined;
onCompositionUpdate?: react.CompositionEventHandler | undefined;
onCompositionUpdateCapture?: react.CompositionEventHandler | undefined;
onFocus?: react.FocusEventHandler | undefined;
onFocusCapture?: react.FocusEventHandler | undefined;
onBlur?: react.FocusEventHandler | undefined;
onBlurCapture?: react.FocusEventHandler | undefined;
onChange?: react.FormEventHandler | undefined;
onChangeCapture?: react.FormEventHandler | undefined;
onBeforeInput?: react.FormEventHandler | undefined;
onBeforeInputCapture?: react.FormEventHandler | undefined;
onInput?: react.FormEventHandler | undefined;
onInputCapture?: react.FormEventHandler | undefined;
onReset?: react.FormEventHandler | undefined;
onResetCapture?: react.FormEventHandler | undefined;
onSubmit?: react.FormEventHandler | undefined;
onSubmitCapture?: react.FormEventHandler | undefined;
onInvalid?: react.FormEventHandler | undefined;
onInvalidCapture?: react.FormEventHandler | undefined;
onLoad?: react.ReactEventHandler | undefined;
onLoadCapture?: react.ReactEventHandler | undefined;
onError?: react.ReactEventHandler | undefined;
onErrorCapture?: react.ReactEventHandler | undefined;
onKeyDown?: react.KeyboardEventHandler | undefined;
onKeyDownCapture?: react.KeyboardEventHandler | undefined;
onKeyPress?: react.KeyboardEventHandler | undefined;
onKeyPressCapture?: react.KeyboardEventHandler | undefined;
onKeyUp?: react.KeyboardEventHandler | undefined;
onKeyUpCapture?: react.KeyboardEventHandler | undefined;
onAbort?: react.ReactEventHandler | undefined;
onAbortCapture?: react.ReactEventHandler | undefined;
onCanPlay?: react.ReactEventHandler | undefined;
onCanPlayCapture?: react.ReactEventHandler | undefined;
onCanPlayThrough?: react.ReactEventHandler | undefined;
onCanPlayThroughCapture?: react.ReactEventHandler | undefined;
onDurationChange?: react.ReactEventHandler | undefined;
onDurationChangeCapture?: react.ReactEventHandler | undefined;
onEmptied?: react.ReactEventHandler | undefined;
onEmptiedCapture?: react.ReactEventHandler | undefined;
onEncrypted?: react.ReactEventHandler | undefined;
onEncryptedCapture?: react.ReactEventHandler | undefined;
onEnded?: react.ReactEventHandler | undefined;
onEndedCapture?: react.ReactEventHandler | undefined;
onLoadedData?: react.ReactEventHandler | undefined;
onLoadedDataCapture?: react.ReactEventHandler | undefined;
onLoadedMetadata?: react.ReactEventHandler | undefined;
onLoadedMetadataCapture?: react.ReactEventHandler | undefined;
onLoadStart?: react.ReactEventHandler | undefined;
onLoadStartCapture?: react.ReactEventHandler | undefined;
onPause?: react.ReactEventHandler | undefined;
onPauseCapture?: react.ReactEventHandler