Skip to main content
The Box component renders an empty div container for fine tuning the spacing of components. Commonly used with the Flex component.
ui-extensions-layout-box

Props

You only need to use Box as a wrapper for components that you want to adjust. For example, if you wrap one component in a Box with a flex value, only that one component will have its width adjusted based on the available empty space.
ui-extension-components-box-flex

Usage examples

Using numbers in flex

Use the flex prop in a Box component to assign any extra spacing to components using either a default value (e.g. auto) or a specific number. When using a number, the components will be distributed based on the ratio of their assigned numbers. This also means that, when assigning a flex value for only one Box, you can use any number, because any number by itself will result in all available space being assigned to that Box. For example, the four tiles below take up an increasing amount of space based on their flex values.
ui-extensions-layout-box

Using alignSelf

Use the alignSelf prop to override alignment rules for individual Box components.
ui-extensions-layout-box-alignself
Last modified on March 31, 2026