Motion API

Detailed listing of all motion value related features of Svelte Motion. A lot of the wording is directly copied from framer-motion, Copyright (c) 2018 Framer B.V. MIT License.

Motion

SvelteComponent<Props: MotionProps & { isSVG?:boolean,forwardMotionProps?:boolean }, Events: {}, Slots: MotionSlots >

MotionAdvancedProps

interface

MotionProps

interface extends AnimationProps , VisualElementLifecycles , PanHandlers , TapHandlers , HoverHandlers , FocusHandlers , DraggableProps , LayoutProps , MotionAdvancedProps
Motion props are categorized by the feature they use. Eg. if you want to handle `tap` look for TapHandlers

MotionSVGPathProperties

interface

MotionSlots

{default: { motion: (n: Node) => void, props: object}}
Svelte Motion provides a default slot with two slot props.

MotionStyle

CSSProperties & MotionTransform & MotionSVGPathProperties
CSSProperties can be basically everything CSS has to offer. Pass as object (React style, eg. `background-color: red` as `{backgroundColor:'red'}`)

MotionTransform

interface

ResolvedValues

{[key: string] : string | number}
A generic set of string/number values

SVGPathProperties

interface

Target

interface
As target you can supply an object with nearly all CSS properties, SVG attributes, TransformProperties and SVGPathProperties . All attibutes can be of CustomValueType .

TargetAndTransition

TargetWithKeyframes & { transition?: Transition , transitionEnd?: Target }

TargetResolver

(custom: any, current: Target , velocity: Target ) => TargetAndTransition

TargetWithKeyframes

interface
Like Target , but every attribute can also be filled as keyframes,

Example: { color: ["#123456", "#234567", "#ffffff"], x: 100}

TransformProperties

interface

Variant

TargetAndTransition | TargetResolver

VariantLabels

string | string[]
Either a string, or array of strings, that reference variants defined via the `variants` prop.

Variants

{[key: string]: Variant }

isValidMotionProp

(key: string) => boolean
Check whether a prop name is a valid `MotionProp` key (see MotionProps ).