RN Neo
Components

Box

The foundational layout primitive in RN Neo

Box is the foundational layout component in rn-neo. It renders a React Native View with Neubrutalist styling — borders, hard offset shadows, background colors, and spacing — all driven by theme tokens.

Most other components in the library are built on top of Box, so its props (border, shadow, spacing) show up everywhere.

Usage

import { Box } from 'rn-neo';

<Box backgroundColor="surface" padding="md">
  {/* anything */}
</Box>

// With border and shadow
<Box
  backgroundColor="primary"
  border
  borderSize="thick"
  shadow
  shadowSize="lg"
  padding="lg"
/>

// Custom radius and shadow color
<Box
  backgroundColor="surface"
  border
  shadow
  shadowColor="primary"
  radius="md"
  paddingHorizontal="xl"
  paddingVertical="md"
/>

Shadow

Box uses a box-shadow with zero blur — the hard, flat offset that defines Neubrutalism. The shadow renders as:

{shadowSize}px {shadowSize}px 0 {shadowColor}
Both border and shadow default to false on Box. Pass them explicitly, or set border: true / shadow: true on your theme to enable them globally.

Props

Background

PropTypeDefaultDescription
backgroundColorBgColors | stringBackground color. Accepts a theme token or any hex/color string.

Border

PropTypeDefaultDescription
borderbooleanfalseWhether to show a border.
borderSizeBorderSize | numberFrom themeBorder width. Token or raw number.
borderColorColors | stringFrom themeBorder color.
radiusRadius | numberFrom themeBorder radius. Token or raw number.

Shadow

PropTypeDefaultDescription
shadowbooleanfalseWhether to show a shadow.
shadowSizeShadowSize | numberFrom themeShadow offset in px. Token or raw number.
shadowColorColors | stringFrom themeShadow color.

Spacing

Every padding* and margin* prop accepts a Spacing token or a raw number. This is the canonical spacing reference — other components link here.

PropTypeDescription
paddingSpacing | numberAll sides.
paddingVerticalSpacing | numberTop + bottom.
paddingHorizontalSpacing | numberLeft + right.
paddingTopSpacing | numberSingle side.
paddingBottomSpacing | numberSingle side.
paddingLeftSpacing | numberSingle side.
paddingRightSpacing | numberSingle side.
marginSpacing | numberAll sides.
marginVerticalSpacing | numberTop + bottom.
marginHorizontalSpacing | numberLeft + right.
marginTopSpacing | numberSingle side.
marginBottomSpacing | numberSingle side.
marginLeftSpacing | numberSingle side.
marginRightSpacing | numberSingle side.
Box also accepts all standard React Native ViewProps (style, testID, accessible, …). The style prop is applied last, so it overrides any token-based style.

On this page