No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

Flex

A layout container using flexbox.

usage
import { Flex, Inline, Stack } from "@sharegate/orbit-ui";
sources
Github

Usage

Flex layout offer a lot of options to solve a bunch of use cases. This page only showcase a few use cases. For a thorough documentation, please have a look at MDN.

Horizontal alignment

A flex layout can have horizontally aligned items.

Editable example

Vertical alignment

A flex layout can have vertically aligned items.

Editable example

Gap

A flex layout can have a gap between his items. columnGap and rowGap are also available to specify a gap for a single axis.

Editable example

Align items

A flex layout can align his items along the cross axis. When the direction is "column", this refers to horizontal alignment, and when direction is "row" it refers to vertical alignment.

Editable example

Justify content

A flex layout can align his items along the main axis. When direction is "column", this refers to vertical alignment, and when direction is "row" it refers to horizontal alignment.

Editable example

Wrap

A flex layout items can wrap on multiple rows.

Editable example

Reverse

A flex layout can reverse the items order.

Editable example

Nesting

Flex layouts can be nested.

Editable example

Inline

An inline utility component is available for horizontal alignment.

Editable example

Stack

A stack utility component is available for vertical alignment.

Editable example

API

Flex

usage
import { Flex } from "@sharegate/orbit-ui";
NameDescriptionDefault
alignContent
See MDN.
"center" | "end" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "space-around" | "space-between" | "space-evenly" | "stretch" | "flex-end" | "flex-start" | "start" | "baseline" | "normal" | string & {} | ResponsiveValue<AlignContent>
-
alignItems
See MDN.
Omit<AlignItems, "flex-end" | "flex-start"> | ResponsiveValue<Omit<AlignItems, "flex-end" | "flex-start">>
-
basis
Alias for flex basis;
0 | "content" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "auto" | "fit-content" | "max-content" | "min-content" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-auto" | ResponsiveValue<FlexBasis<0 | (string & {})>>
-
children*
React children.
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
columnGap
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | string & {} | 1 | 13 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | ResponsiveValue<ColumnGapValue>
-
direction
Alias for flex-direction.
"-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "column" | "column-reverse" | "row" | "row-reverse" | ResponsiveValue<FlexDirection>
-
fluid
Whether the elements take up all the space of their container.
false | true | ResponsiveValue<boolean>
-
gap
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | string & {} | 1 | 13 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | ResponsiveValue<GapValue>
-
grow
See MDN.
"-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | number & {} | ResponsiveValue<FlexGrow>
-
inline
Whether or not the element generate line breaks before or after himself.
falsetrue
-
justifyContent
See MDN.
Omit<JustifyContent, "flex-end" | "flex-start"> | ResponsiveValue<Omit<JustifyContent, "flex-end" | "flex-start">>
-
reverse
Whether or not to reverse the order of the elements.
falsetrue
-
rowGap
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | string & {} | 1 | 13 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | ResponsiveValue<RowGapValue>
-
shrink
See MDN.
"-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | number & {} | ResponsiveValue<FlexShrink>
-
slot
Slot to render into.
string
-
wrap
Alias for flex-wrap.
"-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "nowrap" | "wrap" | "wrap-reverse" | ResponsiveValue<FlexWrap>
-

Inline

usage
import { Inline } from "@sharegate/orbit-ui";
NameDescriptionDefault
alignX
The horizontal alignment of the elements.
"center" | "end" | "start" | ResponsiveValue<FlexAlignment>
-
alignY
The vertical alignment of the elements.
"center" | "end" | "start" | ResponsiveValue<FlexAlignment>
-
children*
React children
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
columnGap
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | string & {} | 1 | 13 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | ResponsiveValue<ColumnGapValue>
-
fluid
Whether the elements take up all the space of their container.
false | true | ResponsiveValue<boolean>
-
gap
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | string & {} | 1 | 13 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | ResponsiveValue<GapValue>
5
inline
Whether or not the element generate line breaks before or after himself.
falsetrue
-
reverse
Whether or not to reverse the order of the elements.
falsetrue
-
rowGap
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | string & {} | 1 | 13 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | ResponsiveValue<RowGapValue>
-
slot
Slot to render into.
string
-
wrap
Whether or not to wrap the elements on multiple lines.
false | true | ResponsiveValue<boolean>
true

Stack

usage
import { Stack } from "@sharegate/orbit-ui";
NameDescriptionDefault
alignX
The horizontal alignment of the elements.
"center" | "end" | "start" | ResponsiveValue<FlexAlignment>
-
alignY
The vertical alignment of the elements.
"center" | "end" | "start" | ResponsiveValue<FlexAlignment>
-
children*
React children
string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal
-
columnGap
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | string & {} | 1 | 13 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | ResponsiveValue<ColumnGapValue>
-
fluid
Whether the elements take up all the space of their container.
false | true | ResponsiveValue<boolean>
-
gap
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | string & {} | 1 | 13 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | ResponsiveValue<GapValue>
5
inline
Whether or not the element generate line breaks before or after himself.
falsetrue
-
reverse
Whether or not to reverse the order of the elements.
falsetrue
-
rowGap
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | string & {} | 1 | 13 | 2 | 3 | 4 | 6 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | ResponsiveValue<RowGapValue>
-
slot
Slot to render into.
string
-
wrap
Whether or not to wrap the elements on multiple lines.
false | true | ResponsiveValue<boolean>
-