Skip to main content

Layout

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

github
View source code

Overview

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

Deprecated

Layout is deprecated and will be removed in a v3 of Abyss. It is in maintenance status and will only receive bug fixes if found. Please migrate to Stack or Group instead.

See the Layout Guide for help choosing between the new layout components.

See the Layout Guide for help choosing between the new layout components.

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​

NameTypeDefaultRequiredDescription
alignItems
'top' | 'center' | 'bottom' | undefined
'center'
-
Adjust the vertical alignment of items in the group
alignLayout
'left' | 'center' | 'right' | 'between' | 'around' | undefined
'left'
-
Set the position of the group
children
React.ReactNode
-
The element the group wraps
grow
boolean | undefined
false
-
Flag to stretch grouped components to fit evenly or not
shrink
boolean | undefined
--
Flag to indicate whether the grouped components should be shrunk to
fill the space horizontally in a Group, to prevent an overflow
space
Abyss.Space | undefined
8
-
Distance between elements in the Group component
width
Abyss.Size | undefined
--
Set the width of the group
wrap
boolean | undefined
--
Flag indicating if the elements should wrap to a new line

Layout.Stack Props​

NameTypeDefaultRequiredDescription
alignItems
'left' | 'center' | 'right' | undefined
'center'
-
Adjust the horizontal alignment of items in the stack
alignLayout
'left' | 'center' | 'right' | undefined
'left'
-
Set the position of the stack
children
React.ReactNode
-
The element the stack wraps
grow
boolean | undefined
false
-
Flag to stretch grouped components to fit evenly or not
space
Abyss.Space | undefined
8
-
Distance between elements in the Stack component
width
Abyss.Size | undefined
--
Set the width of the stack
wrap
boolean | undefined
--
Flag to wrap the stack elements

Layout.Insert Props​

NameTypeDefaultRequiredDescription
after
React.ReactNode | (() => React.ReactNode) | undefined
--
Insert element after children
before
React.ReactNode | (() => React.ReactNode) | undefined
--
Insert element before children
children
React.ReactNode | undefined
--
The element the inserted elements are between
direction
'row' | 'column' | undefined
'row'
-
The direction of of all the the elements
padding
Abyss.Space | undefined
'$semantic.spacing.sm'
-
The space between the inserted element and children

Layout.Space Props​

NameTypeDefaultRequiredDescription
space
Abyss.Space | undefined
16
-
The amount of space to place between components

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