Skip to main content

PanArea

The PanArea component provides layout and interactions for a pannable zone of the design experience. The parent of the PanArea is responsible for responding to the user's panning events (e.g. right clicking and dragging) via the panOffsetChange prop and passing in the new panOffset.

nametyperequiredcomment
childrenReactNode | ReactNode[]yes
panOffset{ x: number; y: number }yes

The current offset from the top-left of the pan container.

panOffsetChange(value: { x: number; y: number }) => voidyes
allowUserPanbooleanno

Enable or disable the user's ability to change the pan offset with a click and drag.

Default value: true
animateOnPanbooleanno

Whether to use a CSS transition to update the pan offset.

Default value: false
ariaLabelstringno
classNamestringno
onAnimationEnd() => voidno
panTransitionDurationnumberno

Duration in milliseconds of the transition from the old pan offset to the new one.

Default value: 500
panTransitionTimingstringno

The transition-timing-function for the pan transition.

Default value: 'ease-in-out'
registerPanContainer(element: HTMLDivElement) => voidno
roleAriaRoleno
styleCSSPropertiesno
Result
Loading...
Live Editor