Skip to main content

Grid

The Grid component can be used to layout its children with the help of CSS Grid. The component can be customized with CSS grid props.

More information about CSS Grid.

Import

import { Grid } from '@dynatrace/strato-components-preview/layouts-core';

Use cases

Grid props

In the example below the gridTemplateColumns prop is used. The same approach can be used for other CSS grid properties.

CodeSandbox

Grid item

The prop gridItem can be set on any Grid component to mark it as a child of another Grid component. When a Grid component is set to gridItem, properties for CSS grid items can be used on that component.

CodeSandbox

Props

GridProps

Signature:

export declare type GridProps<E extends > = <E, >;

GridOwnProps

Signature:

export declare type GridOwnProps = & & & ;

FlexItemProps

Signature:

export declare type FlexItemProps = ;

FlexItemCSS

Signature:

export declare type FlexItemCSS = <, | | | | | >;

GridItemProps

Signature:

export declare type GridItemProps = ;

GridItemCSS

Signature:

export declare type GridItemCSS = <, | | | | | | | | | >;

GridContainerProps

Signature:

export declare type GridContainerProps = & { gap?: ; };

GridContainerCSS

Signature:

export declare type GridContainerCSS = <, | | | | | | | | | | | | | | | | | | | >;

LayoutProps

extends, , ,

PaddingProps

NameTypeDefaultDescription
padding?
8
p?
-
paddingX?
-
px?
-
paddingY?
-
py?
-
paddingTop?
-
pt?
-
paddingRight?
-
pr?
-
paddingBottom?
-
pb?
-
paddingLeft?
-
pl?
-

MarginProps

NameTypeDefaultDescription
margin?
0
m?
-
marginX?
-
mx?
-
marginY?
-
my?
-
marginTop?
-
mt?
-
marginRight?
-
mr?
-
marginBottom?
-
mb?
-
marginLeft?
-
ml?
-

LayoutSizeCSS

Signature:

export declare type LayoutSizeCSS = <, | | | | | >;
Still have questions?
Find answers in the Dynatrace Community