GridnewNEW

A flexible and powerful component for grid layout

Usage

import { Grid } from "@raystack/apsara/v1";
 
<Grid columns={2} rows={2}>
  <Grid.Item>1</Grid.Item>
  <Grid.Item>2</Grid.Item>
  <Grid.Item>3</Grid.Item>
</Grid>;

Grid Props

PropTypeDefault
templateAreas
string | string[]
-
autoFlow
"row" | "column" | "dense" | "row dense" | "column dense"
-
autoColumns
string
-
autoRows
string
-
columns
string | number
-
rows
string | number
-
gap
"extra-small" | "small" | "medium" | "large" | "extra-large"
-
columnGap
"extra-small" | "small" | "medium" | "large" | "extra-large"
-
rowGap
"extra-small" | "small" | "medium" | "large" | "extra-large"
-
justifyItems
"start" | "end" | "center" | "stretch"
-
alignItems
"start" | "end" | "center" | "stretch"
-
justifyContent
"start" | "end" | "center" | "stretch" | "space-around" | "space-between" | "space-evenly"
-
alignContent
"start" | "end" | "center" | "stretch" | "space-around" | "space-between" | "space-evenly"
-
inline
boolean
false
asChild
boolean
-

Grid.Item Props

Grid.Item is a wrapper component that must be a direct child of Grid. Use it when you need to customize the positioning or styling of individual grid items.

PropTypeDefault
area
string
-
colStart
string | number
-
colEnd
string | number
-
rowStart
string | number
-
rowEnd
string | number
-
colSpan
string | number
-
rowSpan
string | number
-
justifySelf
"start" | "end" | "center" | "stretch"
-
alignSelf
"start" | "end" | "center" | "stretch"
-
asChild
boolean
-

On this page