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 | numberPadding on all sides. Token name or raw dp.
paddingXSpaceToken | numberHorizontal padding shorthand.
paddingYSpaceToken | numberVertical padding shorthand.
paddingTopSpaceToken | numberTop padding.
paddingRightSpaceToken | numberRight padding.
paddingBottomSpaceToken | numberBottom padding.
paddingLeftSpaceToken | numberLeft padding.
marginSpaceToken | numberMargin on all sides.
marginXSpaceToken | numberHorizontal margin shorthand.
marginYSpaceToken | numberVertical margin shorthand.
marginTopSpaceToken | numberTop margin.
marginRightSpaceToken | numberRight margin.
marginBottomSpaceToken | numberBottom margin.
marginLeftSpaceToken | numberLeft 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.
radiusRadiusTokenBorder radius token.
shadowShadowTokenElevation/shadow token.
width'fill' | 'hug' | number | stringFigma-style sizing on the width axis.
height'fill' | 'hug' | number | stringFigma-style sizing on the height axis.
minWidthnumber | stringMinimum width.
minHeightnumber | stringMinimum height.
maxWidthnumber | stringMaximum width.
maxHeightnumber | stringMaximum 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