sigilUI

Box

Generic polymorphic container with shorthand style props for spacing, color, radius, and shadow.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { Box } from "@sigil-ui/components";

Usage

<Box bg="surface" p={16} radius="md" shadow="sm">
  Content inside a styled box
</Box>

Polymorphic element

<Box as="section" bg="primary-muted" py={24} px={16}>
  Renders as a section element
</Box>

With border and margin

<Box borderColor="border" p={12} m={8} radius="lg">
  Bordered box with margin
</Box>

Props

PropTypeDefaultDescription
asElementType"div"HTML element or component to render as
bgstring—Background — token name (e.g. "surface") or raw CSS value
borderColorstring—Border color — token name or raw CSS value
radiusstring—Border radius — token scale key (e.g. "md") or raw CSS value
shadowstring—Box shadow — token scale key (e.g. "sm") or raw CSS value
pnumber | string—Padding (number = px)
pxnumber | string—Horizontal padding
pynumber | string—Vertical padding
mnumber | string—Margin (number = px)
mxnumber | string—Horizontal margin
mynumber | string—Vertical margin
classNamestring—Additional CSS classes