# Box

A utility component for working with spacing.

Tabs: [Guidelines](/components/web/box/box.guidelines.md) · [Code](/components/web/box/box.code.md)

## Basic usage

First, import the component.

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

Then use it like so:

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

See the [API reference](https://telescope.pleo.io/components/web/box/box.code#api-reference) for every prop, and the [Guidelines](https://telescope.pleo.io/components/web/box/box.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.

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

## API reference

#### `m`

Type: `0 | "auto" | SpacingValues | undefined`

##### Allowed values

- `0`
- `"auto"`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on top, left, bottom and right

#### `margin`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on top, left, bottom and right

#### `marginBottom`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on bottom

#### `marginLeft`

Type: `0 | "auto" | SpacingValues | undefined`

##### Allowed values

- `0`
- `"auto"`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on left

#### `marginRight`

Type: `0 | "auto" | SpacingValues | undefined`

##### Allowed values

- `0`
- `"auto"`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on right

#### `marginTop`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on top

#### `marginX`

Type: `0 | "auto" | SpacingValues | undefined`

##### Allowed values

- `0`
- `"auto"`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on left and right

#### `marginY`

Type: `0 | "auto" | SpacingValues | undefined`

##### Allowed values

- `0`
- `"auto"`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on top and bottom

#### `mb`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on bottom

#### `ml`

Type: `0 | "auto" | SpacingValues | undefined`

##### Allowed values

- `0`
- `"auto"`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on left

#### `mr`

Type: `0 | "auto" | SpacingValues | undefined`

##### Allowed values

- `0`
- `"auto"`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on right

#### `mt`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on top

#### `mx`

Type: `0 | "auto" | SpacingValues | undefined`

##### Allowed values

- `0`
- `"auto"`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on left and right

#### `my`

Type: `0 | "auto" | SpacingValues | undefined`

##### Allowed values

- `0`
- `"auto"`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Margin on top and bottom

#### `p`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on top, left, bottom and right

#### `padding`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on top, left, bottom and right

#### `paddingBottom`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on bottom

#### `paddingLeft`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on left

#### `paddingRight`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on right

#### `paddingTop`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on top

#### `paddingX`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on left and right

#### `paddingY`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on top and bottom

#### `pb`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on bottom

#### `pl`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on left

#### `pr`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on right

#### `pt`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on top

#### `px`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on left and right

#### `py`

Type: `0 | SpacingValues | undefined`

##### Allowed values

- `0`
- `2`
- `4`
- `16`
- `20`
- `24`
- `48`
- `40`
- `8`
- `12`
- `6`
- `10`
- `32`
- `14`
- `18`
- `28`
- `36`
- `44`
- `52`
- `56`
- `60`

Default: -

Padding on top and bottom
