Box

Box is a component to define layout in a grid manner.
Coral uses 24 grid system just like Ant Design, and unified Grid (doesn’t differentiate between Col and Row) flex like Material-UI.

Example

Basic Usage
In the example below, don’t worry about Colorize component, what it does is simply highlighting the Boxes with some colors. It doesn’t affect any layout.
24

12
12

8
8
8

6
6
6
6
View code
Gap
Gap accepts either number or a pair of numbers ([number, number]). If you pass a number, the value will be used for horizontal gap only.
12
6
6
12
6
6
View code
If you pass pair of numbers, the first and second values are used for horizontal and vertical gaps consecutively.
12
6
6
8
8
8
View code
Flex properties
Align Items

flex-start

8
8
8

center

8
8
8
View code
Direction

row

12
8
4

column

12
8
4
View code

References

API

Box
Prop nameTypeDefaultDescription
alignContentAlignContentstretch
Equivalent to CSS align-content property.
alignItemsAlignItemsstretch
Equivalent to CSS align-items property.
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
directionFlexDirectionrow
Equivalent to CSS flex-direction property.
gapGap0
Determines spacing (some call it gutter) between child Boxes. If a number is passed, it's used as horizontal only. If a pair of number is passed, it's used as horizontal and vertical respectively.
justifyJustifyContentflex-start
Equivalent to CSS justify-content property.
spannumber24
Width of the box. One row can fit at most total of 24 span. More than that, it will wrap to next row, just like a flex.
wrapFlexWrapwrap
Equivalent to CSS flex-wrap property.
    Example
    Example
    Basic Usage
    Basic Usage
    Gap
    Gap
    Flex properties
    Flex properties
    References
    References
    API
    API
    Box
    Box
Coral is a thoroughly developed design system widely adopted by developers and designers for creating beautiful and user-friendly Sea internal products.

Copyright © 2018-2025 Sea Labs