getAxis
Commons
stable
Return the scroll/layout axis ('x' or 'y') for a parsed anchor object. Block-flow sides (top, bottom) map to the Y axis; inline sides (left, right) map to the X axis.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- anchorrequiredTParsedAnchor
- Parsed anchor object with a 'side' property. Block sides (top/bottom) → 'y'; inline sides (left/right) → 'x'.
API
Return value
The value returned by this util.
- The logical axis string: 'y' for vertical (top/bottom), 'x' for horizontal (left/right).
Usage
Examples
Ready-to-paste usage snippets.
Determine axis from anchor