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.

Grid

A layout container using grid.

usage
import { Grid, repeat, minmax, fitContent } from "@sharegate/orbit-ui";
sources
Github

Usage

Grid 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.

Areas

A grid can define explicit sections with areas.

Editable example

Template columns

A grid can define explicit columns (and rows). A value can be a grid length value or an Orbit spacing scale value.

Editable example

Auto columns

A grid can define the size of implicitly created columns. A value can be a grid length value or an Orbit spacing scale value.

Editable example

Gap

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

Editable example

Column spanning

A grid item can span over multiple columns.

Editable example

Nesting

Grids can be nested.

Editable example

Repeat

A custom repeat function is available to support Orbit spacing scale values. However, if you prefer, you can use the native CSS repeat function

Editable example

Minmax

A custom minmax function is available to support Orbit spacing scalue values. However, if you prefer, you can use the native CSS minmax function

Editable example

Fit-content

Mars
Pluto
Jupiter
Editable example

API

Grid

usage
import { Grid } 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.
"center" | "end" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "stretch" | "flex-end" | "flex-start" | "start" | "baseline" | "normal" | string & {} | "self-end" | "self-start" | ResponsiveValue<AlignItems>
-
areas
See MDN.
string[] | ResponsiveValue<string[]>
-
autoColumns
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "auto" | 1 | 13 | 2 | 3 | 4 | 6 | 14 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | "max-content" | "min-content" | 15 | 16 | 17 | 18 | ResponsiveValue<GridAutoColumnsValue>
-
autoFlow
See MDN.
"-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "column" | "row" | "dense" | ResponsiveValue<GridAutoFlow>
-
autoRows
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "auto" | 1 | 13 | 2 | 3 | 4 | 6 | 14 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | "max-content" | "min-content" | 15 | 16 | 17 | 18 | ResponsiveValue<GridAutoRowsValue>
-
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>
-
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>
-
inline
Whether or not the element generate line breaks before or after himself.
falsetrue
-
justifyContent
See MDN.
"center" | "left" | "right" | "end" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "space-around" | "space-between" | "space-evenly" | "stretch" | "flex-end" | "flex-start" | "start" | "normal" | string & {} | ResponsiveValue<JustifyContent>
-
justifyItems
See MDN.
"center" | "left" | "right" | "end" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "stretch" | "flex-end" | "flex-start" | "start" | "baseline" | "normal" | string & {} | "self-end" | "self-start" | "legacy" | ResponsiveValue<JustifyItems>
-
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
-
templateColumns
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "auto" | 1 | "none" | 13 | 2 | 3 | 4 | 6 | 14 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | "max-content" | "min-content" | 15 | 16 | 17 | 18 | "subgrid" | GridTemplateColumnsValue[] | ResponsiveValue<GridTemplateColumnsValue | GridTemplateColumnsValue[]>
-
templateRows
See MDN.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "auto" | 1 | "none" | 13 | 2 | 3 | 4 | 6 | 14 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | "max-content" | "min-content" | 15 | 16 | 17 | 18 | "subgrid" | GridTemplateRowsValue[] | ResponsiveValue<GridTemplateRowsValue | GridTemplateRowsValue[]>
-