Skip to main content

Layout

A single or multi-section container used to display content related to a single subject.

github
View source code

Layout is a set of organizational components that follow the patterns of Flexbox.

Layout.Group

Used to align elements in a row.

Layout.Stack

Used to align elements in a column.

Layout.Group and Layout.Stack Props

Space

Use the space property to set the spacing for a Group or Stack. The default is set to 8.

AlignLayout

Use the alignLayout property to indicate the horizontal alignment of the items in a Group or Stack. For a Group, the possible options are left, center, and right. For a Stack, the possible options are left, center, and right. The default is set to left in both cases.

AlignItems

Use the alignItems property to indicate the alignment of the items in a Group or Stack. For a Group the vertical alignment is adjusted, whereas for a Stack the horizontal alignment is adjusted. For a Group, the possible options are top, center, and bottom. For a Stack, the possible options are left, center, and right. The default is set to center in both cases.

Grow

Use the grow property to indicate whether the grouped components should be stretched to fill the space horizontally. The default is set to false.

Shrink

Use the shrink property to indicate whether the grouped components should be shrunk to fill the space horizontally in a Group, to prevent an overflow. The default is set to false.

Layout.Insert

Used to place elements before and after a central component. Padding is $semantic.spacing.sm and direction is row by default.

Layout.Space

Adds a space of height space. Default is 16px.

Layout.Group Props

Prop NameTypeDefaultDescription
alignItemstop | center | bottomcenterAdjust the vertical alignment of items in the group
alignLayoutleft | center | rightleftSet the position of the group
childrenReactNode-The element the group wraps
growbooleanfalseFlag to stretch grouped components to fit evenly or not
shrinkbooleanfalseFlag to indicate whether the grouped components should be shrunk to ill the space horizontally in a Group, to prevent an overflow
spacenumber$layout-group.spaceDistance between elements in the Group component
widthnumber | string-Set the width of the group
wrapbooleanfalseFlag indicating if the elements should wrap to a new line
wrapboolean-Flag indicating if the elements should wrap to a new line

Layout.Stack Props

Prop NameTypeDefaultDescription
alignItemsleft | center | rightcenterAdjust the horizontal alignment of items in the stack
alignLayoutleft | center | rightleftSet the position of the stack
childrenReactNode-The element the stack wraps
growbooleanfalseFlag to stretch grouped components to fit evenly or not
spacenumber8Distance between elements in the Group component
widthnumber | string-Set the width of the stack

Layout.Insert Props

Prop NameTypeDefaultDescription
afternode-Element displayed after children
beforenode-Element displayed before children
childrenReactNode-The elements in the center
directionrow | columnrowPosition of before and after nodes
growbooleanfalseFlag to stretch grouped components to fit evenly or not
paddingnumber$semantic.spacing.smPadding between elements

Layout.Space Props

Prop NameTypeDefaultDescription
spacenumber | string16The height of the space

Layout.Group Classes

Class NameDescription
abyss-layout-group-rootGroup root element

Layout.Stack Classes

Class NameDescription
abyss-layout-stack-rootStack root element

Layout.Insert Classes

Class NameDescription
abyss-layout-insert-rootInsert root element
abyss-layout-insert-beforeInsert before element
abyss-layout-insert-afterInsert after element

Layout.Space Classes

Class NameDescription
abyss-layout-space-rootSpace root element
Table of Contents