Skip to main content

Layout

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

Submit feedback
github

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

Layout.Group

Used to align elements in a row.

      <Layout.Group>
      <Box color="#D0F1F5" padding={20}>
      <Text>Group 1</Text>
      </Box>
      <Box color="#D0F1F5" padding={15}>
      <Text>Group 2</Text>
      </Box>
      <Box color="#D0F1F5" padding={10}>
      <Text>Group 3</Text>
      </Box>
      </Layout.Group>

      Layout.Stack

      Used to align elements in a column.

          <Layout.Stack>
          <Box color="#D0F1F5" padding={20} >
          <Text>Stack 1</Text>
          </Box>
          <Box color="#D0F1F5" padding={15} >
          <Text>Stack 2</Text>
          </Box>
          <Box color="#D0F1F5" padding={10}>
          <Text>Stack 3</Text>
          </Box>
          </Layout.Stack>

          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 rowby 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-groupGroup root element

          Layout.Stack Classes

          Class NameDescription
          abyss-layout-stackStack root element

          Layout.Insert Classes

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

          Layout.Space Classes

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