Grid

A CSS grid container. On a narrow screen, its columns collapse towards one column.

Examples

Loading examples…

Props

PropTypeDescription
align"start" | "center" | "end" | "baseline" | "stretch"
justify"start" | "center" | "end" | "spaceBetween" | "spaceAround" | "spaceEvenly" | "stretch"
wrap"nowrap" | "wrap" | "wrap-reverse"
gapnumber | string4px steps when a number
rowGapnumber | string
columnGapnumber | string
paddingnumber | string4px steps when a number
backgroundstringOne of surface|surface-secondary|surface-tertiary|surface-elevated|surface-elevated-secondary|surface-inverted|surface-soft|info|warning|caution|success|danger|discovery|info-solid|warning-solid|caution-solid|success-solid|danger-solid|discovery-solid or a CSS color. Leave it unset. Only one summary panel in a Card can use "surface-secondary"
borderboolean
borderColor"default" | "subtle" | "strong" | "info" | "warning" | "caution" | "success" | "danger" | "discovery"
radius"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "full" | number | string | object
widthnumber | string
heightnumber | string
minWidthnumber | string
maxWidthnumber | string
minHeightnumber | string
maxHeightnumber | string
flexnumber
weightnumberflex-grow in a Row or Column
aspectRatiostring
scrollableboolean
clipboolean
shadowboolean
inlineboolean
rolestringARIA role
flushbooleanNo padding
minSizenumber | stringMinimum width and height
maxSizenumber | stringMaximum width and height
disableAutoSpacingbooleanNo default gap between children
columnsnumber | stringColumn count or CSS template. Default 2
minChildWidthnumber | string
rowsnumber | string

Slots

  • children · multiple

Events

  • onVisible · Sent once, the first time the container scrolls into view. Use it to load more content lazily.

GridItem

A cell of a Grid, with an optional span. A span that covers all rendered columns fills the row.

Loading examples…

PropTypeDescription
align"start" | "center" | "end" | "baseline" | "stretch"
justify"start" | "center" | "end" | "spaceBetween" | "spaceAround" | "spaceEvenly" | "stretch"
wrap"nowrap" | "wrap" | "wrap-reverse"
gapnumber | string4px steps when a number
rowGapnumber | string
columnGapnumber | string
paddingnumber | string4px steps when a number
backgroundstringOne of surface|surface-secondary|surface-tertiary|surface-elevated|surface-elevated-secondary|surface-inverted|surface-soft|info|warning|caution|success|danger|discovery|info-solid|warning-solid|caution-solid|success-solid|danger-solid|discovery-solid or a CSS color. Leave it unset. Only one summary panel in a Card can use "surface-secondary"
borderboolean
borderColor"default" | "subtle" | "strong" | "info" | "warning" | "caution" | "success" | "danger" | "discovery"
radius"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "full" | number | string | object
widthnumber | string
heightnumber | string
minWidthnumber | string
maxWidthnumber | string
minHeightnumber | string
maxHeightnumber | string
flexnumber
weightnumberflex-grow in a Row or Column
aspectRatiostring
scrollableboolean
clipboolean
shadowboolean
inlineboolean
rolestringARIA role
flushbooleanNo padding
minSizenumber | stringMinimum width and height
maxSizenumber | stringMaximum width and height
disableAutoSpacingbooleanNo default gap between children
spannumber
rowSpannumber

Slots

  • children · multiple

Events

  • onVisible · Sent once, the first time the container scrolls into view. Use it to load more content lazily.

Link to Grid · All standard components