Skip to main content

Box

Used as a blanket filler to surround any number of components with color or create a box of predefined size.

github
View source code
import { Box } from '@uhg-abyss/mobile';
() => {
return <Box width={100}></Box>;
};

Basic Usage

Box is a container component that can be used to organize or structure a screen. Use height and width to control the size.

Children

Box takes children of type node.

Color

The color prop sets the background color. The default is set to $semantic.color.surface.interactive.standards.rest.quaternary.

Padding

The padding prop sets the padding in all directions. The default is set to $md.

Search Message Example

A simple component that displays a message with a link to search for a different term. Design

Box Props

Prop NameTypeDefaultDescription
childrennode-Children of the Box component
colorstring$semantic.color.surface.interactive.standards.rest.quaternarySet color of Box
heightnumber | string100%Set height of Box
paddingnumber | string$semantic.spacing.lgSet padding of Box
widthnumber | string100%Set width of Box

Box Classes

Class NameDescription
abyss-box-rootBox root element
Table of Contents