Skip to content
RefineUI

Box

Padding, semantic fill, radius, and border — the base layout surface.

Box applies Foundation spacing, color, radius, and stroke tokens to a single surface. Use it when you need a token-backed wrapper without inventing CSS.

Inset content

Overview

Machine-readable contract from Component Spec.

component: boxexport: Boxversion: 1attributes: data-refineui=box

Anatomy

Partdata-refineui
rootbox

Layout

PropertyValue
directionlogical
rtltrue
npm install @refineui/react @refineui/tokens
import { Box } from "@refineui/react";
<Box padding="sizeLarge" background="backgroundSurface" radius="roundedLarge">
Content
</Box>
<Box
as="section"
paddingX="sizeLarge"
paddingY="sizeSmall"
border="strokeWidthThin"
borderColor="borderDefault"
background="backgroundPrimary"
>
Outlined section
</Box>
PropDefaultTypeDescription
as"div"ElementTypeRoot element.
paddingSpacing tokenPadding on all sides.
paddingXSpacing tokenHorizontal padding.
paddingYSpacing tokenVertical padding.
backgroundBackground / surface aliasFill color.
radiusRadius tokenCorner radius.
borderStroke tokenBorder width.
borderColorBorder color aliasBorder color (defaults with `border`).