A utility component for working with spacing.
Features
- Shorthand margin and padding CSS declarations.
Adheres to our spacing tokens.
Basic usage
First, import the component.
import {Box} from '@pleo-io/telescope'Then use it, like so:
<div css={{border: `1px dashed ${tokens.colorBorderStaticLoud}`}}>
<Box p={10} m={10} css={{background: tokens.colorBackgroundStaticInverse}}>
<div css={{width: 40, height: 40, border: `1px dashed ${tokens.colorBorderStaticLoud}`}} />
</Box>
</div>API reference
The component accepts the following props.
| Prop | Type | Default |
|---|---|---|
mMargin on top, left, bottom and right | enum0, "auto", 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
marginMargin on top, left, bottom and right | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
marginBottomMargin on bottom | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
marginLeftMargin on left | enum0, "auto", 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
marginRightMargin on right | enum0, "auto", 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
marginTopMargin on top | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
marginXMargin on left and right | enum0, "auto", 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
marginYMargin on top and bottom | enum0, "auto", 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
mbMargin on bottom | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
mlMargin on left | enum0, "auto", 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
mrMargin on right | enum0, "auto", 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
mtMargin on top | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
mxMargin on left and right | enum0, "auto", 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
myMargin on top and bottom | enum0, "auto", 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
pPadding on top, left, bottom and right | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
paddingPadding on top, left, bottom and right | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
paddingBottomPadding on bottom | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
paddingLeftPadding on left | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
paddingRightPadding on right | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
paddingTopPadding on top | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
paddingXPadding on left and right | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
paddingYPadding on top and bottom | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
pbPadding on bottom | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
plPadding on left | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
prPadding on right | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
ptPadding on top | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
pxPadding on left and right | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 | |
pyPadding on top and bottom | enum0, 2, 4, 16, 20, 24, 48, 40, 8, 12, 6, 10, 32, 14, 18, 28, 36, 44, 52, 56, 60 |
Related components
- Inline: A utility component for controlling horizontal layouts.
- Stack: A utility component for controlling vertical layouts.
Didn't find what you were looking for?
Let us know in #team-design-systems or make a request.
Edit this page