Skip to main navigationSkip to main content
Return to Sky UI homepage
import { spacing } from '@sky-uk/ui-core';
spacing(1);
// returns
4px

You can return the spacing without a px suffix by passing false as a second argument. This is useful if you need to use the raw number for calculations.

spacing(1, false);
// returns
4;

Available Spacing Units

KeyValue
00
14px
28px
312px
416px
524px
632px
748px
872px
Spacing - React | Sky UI Design System