MindeesUI
ComponentsLayout

Box

The primitive layout container — padding, margin, background, border, radius, and shadow tokens on a single View.

Box is the lowest-level building block in MindeesUI. It wraps a React Native View and exposes token-aware padding, margin, sizing, and surface props. Reach for it when you need a styled container without the flex behaviour of Stack.

Import

import { Box } from '@mindees/ui';

Usage

<Box padding="md" background="surface" radius="md" shadow="sm">
  <Text>Card content</Text>
</Box>

Props

PropTypeDefaultDescription
paddingSpaceToken | number—Padding on all sides. Token name or raw dp.
paddingXSpaceToken | number—Horizontal padding shorthand.
paddingYSpaceToken | number—Vertical padding shorthand.
paddingTopSpaceToken | number—Top padding.
paddingRightSpaceToken | number—Right padding.
paddingBottomSpaceToken | number—Bottom padding.
paddingLeftSpaceToken | number—Left padding.
marginSpaceToken | number—Margin on all sides.
marginXSpaceToken | number—Horizontal margin shorthand.
marginYSpaceToken | number—Vertical margin shorthand.
marginTopSpaceToken | number—Top margin.
marginRightSpaceToken | number—Right margin.
marginBottomSpaceToken | number—Bottom margin.
marginLeftSpaceToken | number—Left margin.
background'canvas' | 'surface' | 'subtle' | 'elevated'—Semantic theme background key.
borderColor'subtle' | 'default' | 'strong'—Semantic border colour. Triggers a 1-dp border.
borderWidthnumber1Border width when borderColor is set.
radiusRadiusToken—Border radius token.
shadowShadowToken—Elevation/shadow token.
width'fill' | 'hug' | number | string—Figma-style sizing on the width axis.
height'fill' | 'hug' | number | string—Figma-style sizing on the height axis.
minWidthnumber | string—Minimum width.
minHeightnumber | string—Minimum height.
maxWidthnumber | string—Maximum width.
maxHeightnumber | string—Maximum height.
asChildbooleanfalseMerge props onto the immediate child instead of rendering a View.

Any remaining ViewProps are forwarded to the underlying View.

Accessibility

Inherits accessibility from the underlying RN View — pass accessibilityLabel, accessibilityRole, etc. via props.

On this page