MCPcopy Create free account
hub / github.com/adobe/react-spectrum / toLength

Function toLength

packages/react-aria-components/src/Sheet.tsx:600–602  ·  view source on GitHub ↗
(point: number | string)

Source from the content-addressed store, hash-verified

598
599// Converts a snap point value to a CSS length: numbers are pixels.
600function toLength(point: number | string): string {
601 return typeof point === 'number' ? `${point}px` : point;
602}
603
604function SnapPoint({point, align, axis}: SnapPointProps) {
605 let mainUnit = axis === 'y' ? 'dvh' : 'dvw';

Callers 3

SnapPointFunction · 0.85
DetentPointFunction · 0.85
useSwipeAnimationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected