Motion UIComponentsComponent

Mask wipe

A directional page transition that wipes the incoming view into place through a soft animated mask. React 19 canary only.

npx shadcn@latest add @motion/mask-wipe

API reference

Components

<MaskWipeStage />

Full-view shell with a persistent announcement node.

announce

string

Persistent live-region text, for example "Funnels page".

children

ReactNode

Your page shell: header, MaskWipeContent, and navigation.

className?

string

Merged onto the stage.

<MaskWipeContent />

Directional masked crossfade. React transition types keep both snapshots moving in the direction of the current navigation.

page

number

The current page index. Keys the entering and exiting view snapshots.

direction

MaskWipeDirection

Which side the incoming page should reveal from.

width?

number = DEFAULT_MASK_WIDTH

Width of the feather as a percentage of the transitioning view.

children

ReactNode

The current page body.

className?

string

Merged onto the page body wrapper.

<MaskWipeTabs />

Accessible page switcher.

labels

string[]

Page labels in navigation order.

active

number

The active page index.

onSelect

(index: number) => void

Navigate to a page index.

"aria-label"?

string

Accessible navigation name. Defaults to "Pages".

className?

string

Merged onto the navigation.

Hooks

useMaskWipe

Page-level navigation controller. State updates must run inside startTransition for React to activate its View Transition boundary.

useMaskWipe(options: UseMaskWipeOptions): MaskWipeController

initial?

number = 0

The initial page index. Defaults to 0.

Returns

page

number

The current page index.

direction

MaskWipeDirection

The direction of the latest page change.

go

(next: number) => void

Navigate to a page inside a React transition.

Functions

maskWipeFrames

The gradient stays fixed while its oversized image moves. Unlike gradient stops, mask-position interpolates continuously in Chromium.

maskWipeFrames(direction: MaskWipeDirection, width = DEFAULT_MASK_WIDTH): MaskWipeAnimation

maskWipeExitFrames

The outgoing snapshot uses the spatial inverse of the incoming mask.

maskWipeExitFrames(direction: MaskWipeDirection, width = DEFAULT_MASK_WIDTH): MaskWipeAnimation

maskWipeDirection

maskWipeDirection(current: number, next: number): MaskWipeDirection