# Box

## Specification

Box is a primitive component that distributes alignment and spacing.

{% hint style="warning" %}
Box has no control over elements' composition. **Use** [**Composition**](/atomic-layout/api/components/composition.md) **instead**.
{% endhint %}

## Props

Box supports all [Prop aliases](/atomic-layout/fundamentals/prop-aliases.md), *except* those specific to CSS Grid.

| Prop name | Type      | Description              |
| --------- | --------- | ------------------------ |
| `flex`    | `boolean` | Display a box as `flex`. |
| `inline`  | `boolean` | Uses inline display.     |

## Example

{% code title="" %}

```jsx
import React from 'react'
import { Box } from 'atomic-layout'

export const Header = ({ children }) => (
  <Box as="header" padding={10} paddingMd={20}>
    {children}
  </Box>
)
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://redd.gitbook.io/atomic-layout/api/components/box.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
