The Box component is the foundational layout primitive in Theme UI. It provides access to spacing utilities, colors, and theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/system-ui/theme-ui/llms.txt
Use this file to discover all available pages before exploring further.
sx prop for theme-aware styling.
Import
Usage
Props
The Box component accepts all standard HTML div attributes plus the following:Render the component as a different HTML element or React component. Defaults to
'div'.Theme-aware style object for applying CSS with access to theme values.
Apply a variant style from
theme.variants. Use dot notation to access nested variants.Spacing Props
Box includes shorthand props for margin and padding that map to theme space values:Margin on all sides.
Margin top.
Margin right.
Margin bottom.
Margin left.
Margin left and right.
Margin top and bottom.
Padding on all sides.
Padding top.
Padding right.
Padding bottom.
Padding left.
Padding left and right.
Padding top and bottom.
Color Props
Text color from
theme.colors.Background color from
theme.colors.CSS opacity value.
