Skip to main content
Version: v2.x

Geometry Types

Basic geometric types used throughout Drax.

Position​

interface Position {
x: number;
y: number;
}

Used for coordinates, offsets, translations, and snap targets.

ViewDimensions​

interface ViewDimensions {
width: number;
height: number;
}

DraxViewMeasurements​

interface DraxViewMeasurements extends Position, ViewDimensions {}
// Equivalent to: { x: number; y: number; width: number; height: number }

Position relative to the parent DraxProvider root view.

isPosition (type guard)​

const isPosition = (something: unknown): something is Position

Returns true if the value has numeric x and y properties.

DragPhase​

type DragPhase = 'idle' | 'dragging' | 'releasing';

Drives all animated styles via dragPhaseSV SharedValue.