Skip to main content
Version: 0.x (Reanimated 3)

Stage

The Stage is the root of every scene. It renders the underlying Skia canvas (a native view) and owns gesture detection and event dispatch for everything inside it.

import { Stage, Layer, Rect } from 'react-native-canvas-kit';

<Stage width={360} height={640}>
<Layer>
<Rect x={20} y={20} width={100} height={100} fill="#8a2be2" />
</Layer>
</Stage>;

A Stage must contain one or more Layer nodes; shapes live inside layers (or groups within layers).

Props

PropTypeDefaultDescription
widthnumberNoneCanvas width, in points. Required.
heightnumberNoneCanvas height, in points. Required.
styleStyleProp<ViewStyle>NoneStyle for the canvas view (e.g. a backgroundColor).
listeningbooleantrueWhen false, the whole stage ignores pointer/gesture input.
gestureEnabledbooleantrueEnables the pan / pinch / rotate gesture pipeline.
pinchSensitivitynumber1Multiplier on pinch-to-scale sensitivity.
rotationSensitivitynumber1Multiplier on two-finger rotation sensitivity.
childrenReactNodeNoneLayers and groups.

Sizing the stage

The stage does not size itself; pass explicit width and height. To fill the screen, use useWindowDimensions:

import { useWindowDimensions } from 'react-native';

const { width, height } = useWindowDimensions();

<Stage width={width} height={height} style={{ backgroundColor: '#0b0b12' }}>
{/* ... */}
</Stage>;

Background color

The stage itself is transparent. Give it a background with style:

<Stage width={width} height={height} style={{ backgroundColor: '#a441e1' }} />

Disabling interaction

  • listening={false} turns the stage into a static, non-interactive drawing.
  • gestureEnabled={false} keeps taps working but disables the gesture pipeline.

Both are useful when a stage is purely decorative or when another surface (like a modal) should own touches temporarily.