Box

A generic container for building layouts. Use as to render it as a different tag, such as section or nav.

A Box holds content, like any container.

Usage

Code
import { Box } from '@leverui/components';
Code
<Box />

Examples

Render as another tag

as sets the HTML tag. Use it so a container carries meaning, such as a section with a heading, or a nav around links.

Shipping

This Box renders as a section element.

Text style

textStyle sets the font size and line height for everything inside.

Larger text for everything inside this Box.

Composition

A listing card built from Box, Image, Badge, and Text.

Modern single-storey home with a pool and patio
Top host

4.8 (52)

Modern home with a pool and garden, ten minutes from the beach

$310 • 4 beds

Props

PropDefaultTypeDescription
asdivHTML tag nameThe tag to render, such as section or nav.
asChild—Solid render callbackRender your own element in place of the default.
textStyle—stringA text style, such as sm or lg, for everything inside.

Box also takes any attribute its tag accepts, such as id, class, or onClick.

Style a Box with a CSS class. It has no props for colors or spacing.