Skip to content
Components

Box

A utility component for working with spacing.

Basic usage

First, import the component.

import {Box} from '@pleo-io/telescope'

Then use it like so:

import {Box} from '@pleo-io/telescope'
;<Box p={16} m={16}>
    Content
</Box>

See the API reference for every prop, and the Guidelines for when to use each spacing option.


Examples

Horizontal and vertical spacing

Use axis-specific spacing when horizontal and vertical padding need to differ. Shorthand and full prop names are both supported.

import {Box} from '@pleo-io/telescope'
;<Box px={24} py={16} marginBottom={16}>
    Content
</Box>

API reference

PropTypeDefault
m
enum
margin
enum
marginBottom
enum
marginLeft
enum
marginRight
enum
marginTop
enum
marginX
enum
marginY
enum
mb
enum
ml
enum
mr
enum
mt
enum
mx
enum
my
enum
p
enum
padding
enum
paddingBottom
enum
paddingLeft
enum
paddingRight
enum
paddingTop
enum
paddingX
enum
paddingY
enum
pb
enum
pl
enum
pr
enum
pt
enum
px
enum
py
enum
Didn't find what you were looking for?
Edit this page