Grid
Use s-grid
to organize your content in a matrix of rows and columns and make responsive layouts for pages. Grid follows the same pattern as the CSS grid layout.
Anchor to propertiesProperties
- Anchor to accessibilityLabelaccessibilityLabelstring
A label that describes the purpose or contents of the element. When set, it will be announced to users using assistive technologies and will provide them with more context.
Only use this when the element's content is not enough context for users using assistive technologies.
- Anchor to accessibilityRoleaccessibilityRole
Sets the semantic meaning of the component’s content. When set, the role will be used by assistive technologies to help users navigate the page.
- Anchor to accessibilityVisibilityaccessibilityVisibility"visible" | "hidden" | "exclusive"
Changes the visibility of the element.
visible
: the element is visible to all users.hidden
: the element is removed from the accessibility tree but remains visible.exclusive
: the element is visually hidden but remains in the accessibility tree.
- Anchor to alignContentalignContent"" |
Aligns the grid along the block (column) axis.
This overrides the block value of
.
- Anchor to alignItemsalignItems"" |
Aligns the grid items along the block (column) axis.
This overrides the block value of
.
- Anchor to backgroundbackground
Adjust the background of the element.
- Anchor to blockSizeblockSize
Adjust the block size.
- Anchor to borderborder
Set the border via the shorthand property.
This can be a size, optionally followed by a color, optionally followed by a style.
If the color is not specified, it will be
base
.If the style is not specified, it will be
auto
.Values can be overridden by
,
, and
.
- Anchor to borderColorborderColor"" |
Set the color of the border.
If set, it takes precedence over the
border
property's color.- Anchor to borderRadiusborderRadius<>
Set the radius of the border.
1-to-4-value syntax is supported. Note that, contrary to the CSS, it uses flow-relative values and the order is:
- 4 values:
start-start start-end end-end end-start
- 3 values:
start-start (start-end & end-start) start-end
- 2 values:
(start-start & end-end) (start-end & end-start)
For example:
small-100
means start-start, start-end, end-end and end-start border radii aresmall-100
.small-100 none
means start-start and end-end border radii aresmall-100
, start-end and end-start border radii arenone
.small-100 none large-100
means start-start border radius issmall-100
, start-end border radius isnone
, end-end border radius islarge-100
and end-start border radius isnone
.small-100 none large-100 small-100
means start-start border radius issmall-100
, start-end border radius isnone
, end-end border radius islarge-100
and end-start border radius issmall-100
.
- 4 values:
- Anchor to borderStyleborderStyle"" | <>
Set the style of the border.
If set, it takes precedence over the
border
property's style.Like CSS, up to 4 values can be specified.
If one value is specified, it applies to all sides.
If two values are specified, they apply to the block sides and inline sides respectively.
If three values are specified, they apply to the block-start, both inline sides, and block-end respectively.
If four values are specified, they apply to the block-start, block-end, inline-start, and inline-end sides respectively.
- Anchor to borderWidthborderWidth"" | <"small" | "small-100" | "base" | "large" | "large-100" | "none">
Set the width of the border.
If set, it takes precedence over the
border
property's width.Like CSS, up to 4 values can be specified.
If one value is specified, it applies to all sides.
If two values are specified, they apply to the block sides and inline sides respectively.
If three values are specified, they apply to the block-start, both inline sides, and block-end respectively.
If four values are specified, they apply to the block-start, block-end, inline-start, and inline-end sides respectively.
- Anchor to columnGapcolumnGap<"" | >
Adjust spacing between elements in the inline axis.
This overrides the column value of
gap
.either accepts: * a single SpacingKeyword value (e.g.
large-100
) * OR a container query string with supported SpacingKeyword values as query values (e.g. @container (inline-size > 500px) large-300, small-300)- Anchor to displaydisplay<"auto" | "none">
Sets the outer display type of the component. The outer type sets a component's participation in flow layout.
auto
the component's initial value. The actual value depends on the component and context.none
hides the component from display and removes it from the accessibility tree, making it invisible to screen readers.
- <<>>
Adjust spacing between elements.
gap
can either accept: * a single SpacingKeyword value applied to both axes (e.g.large-100
). *OR a pair of values (eglarge-100 large-500
) can be used to set the inline and block axes respectively. OR a container query string with supported SpacingKeyword values as query values (e.g.@container (inline-size > 500px) large-300, small-300)- Anchor to gridTemplateColumnsgridTemplateColumnsstring
Define columns and specify their size.
- Anchor to gridTemplateRowsgridTemplateRowsstring
Define rows and specify their size.
- Anchor to inlineSizeinlineSize
Adjust the inline size.
- Anchor to justifyContentjustifyContent"" |
Aligns the grid along the inline (row) axis.
This overrides the inline value of
.
- Anchor to justifyItemsjustifyItems"" |
Aligns the grid items along the inline (row) axis.
This overrides the inline value of
.
- Anchor to maxBlockSizemaxBlockSize
Adjust the maximum block size.
- Anchor to maxInlineSizemaxInlineSize
Adjust the maximum inline size.
- Anchor to minBlockSizeminBlockSize
Adjust the minimum block size.
- Anchor to minInlineSizeminInlineSize
Adjust the minimum inline size.
- Anchor to overflowoverflow"visible" | "hidden"
Sets the overflow behavior of the element.
hidden
: clips the content when it is larger than the element’s container. The element will not be scrollable and the users will not be able to access the clipped content by dragging or using a scroll wheel on a mouse.visible
: the content that extends beyond the element’s container is visible.
- Anchor to paddingpadding<<>>
Adjust the padding of all edges.
1-to-4-value syntax (@see https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#edges_of_a_box) is supported. Note that, contrary to the CSS, it uses flow-relative values and the order is:
- 4 values:
block-start inline-end block-end inline-start
- 3 values:
block-start inline block-end
- 2 values:
block inline
For example:
large
means block-start, inline-end, block-end and inline-start paddings arelarge
.large none
means block-start and block-end paddings arelarge
, inline-start and inline-end paddings arenone
.large none large
means block-start padding islarge
, inline-end padding isnone
, block-end padding islarge
and inline-start padding isnone
.large none large small
means block-start padding islarge
, inline-end padding isnone
, block-end padding islarge
and inline-start padding issmall
.
A padding value of
auto
will use the default padding for the closest container that has had its usual padding removed.padding
also accepts a container query string with the supported PaddingKeyword as a query value e.g. (@container (inline-size > 500px) large-300, small-300
)This also accepts up to 4 values (e.g.
@container (inline-size > 500px) large-300 small-300 large-100 small-100, small-200
)- 4 values:
- Anchor to paddingBlockpaddingBlock<"" | <>>
Adjust the block-padding.
large none
means block-start padding islarge
, block-end padding isnone
.
This overrides the block value of
padding
.also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
)This also accepts up to 2 values (e.g.
@container (inline-size > 500px) large-300 small-300, small-200
)- Anchor to paddingBlockEndpaddingBlockEnd<"" | >
Adjust the block-end padding.
This overrides the block-end value of
.
also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
)This only accepts up to 1 value per predicate (e.g.
@container (inline-size > 500px) large-300, small-200
)- Anchor to paddingBlockStartpaddingBlockStart<"" | >
Adjust the block-start padding.
This overrides the block-start value of
.
also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
)This only accepts 1 value per predicate (e.g.
@container (inline-size > 500px) large-300, small-200
)- Anchor to paddingInlinepaddingInline<"" | <>>
Adjust the inline padding.
large none
means inline-start padding islarge
, inline-end padding isnone
.
This overrides the inline value of
padding
.also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
)This also accepts up to 2 values (e.g.
@container (inline-size > 500px) large-300 small-300, small-200
)- Anchor to paddingInlineEndpaddingInlineEnd<"" | >
Adjust the inline-end padding.
This overrides the inline-end value of
.
also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
) This only accepts 1 value per predicate (e.g.@container (inline-size > 500px) large-300, small-200
)- Anchor to paddingInlineStartpaddingInlineStart<"" | >
Adjust the inline-start padding.
This overrides the inline-start value of
.
also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
) This only accepts 1 value per predicate (e.g.@container (inline-size > 500px) large-300, small-200
)- Anchor to placeContentplaceContent"normal normal" | "normal stretch" | "normal start" | "normal end" | "normal center" | "normal unsafe start" | "normal unsafe end" | "normal unsafe center" | "normal safe start" | "normal safe end" | "normal safe center" | "stretch normal" | "stretch stretch" | "stretch start" | "stretch end" | "stretch center" | "stretch unsafe start" | "stretch unsafe end" | "stretch unsafe center" | "stretch safe start" | "stretch safe end" | "stretch safe center" | "baseline normal" | "baseline stretch" | "baseline start" | "baseline end" | "baseline center" | "baseline unsafe start" | "baseline unsafe end" | "baseline unsafe center" | "baseline safe start" | "baseline safe end" | "baseline safe center" | "first baseline normal" | "first baseline stretch" | "first baseline start" | "first baseline end" | "first baseline center" | "first baseline unsafe start" | "first baseline unsafe end" | "first baseline unsafe center" | "first baseline safe start" | "first baseline safe end" | "first baseline safe center" | "last baseline normal" | "last baseline stretch" | "last baseline start" | "last baseline end" | "last baseline center" | "last baseline unsafe start" | "last baseline unsafe end" | "last baseline unsafe center" | "last baseline safe start" | "last baseline safe end" | "last baseline safe center" | "start normal" | "start stretch" | "start start" | "start end" | "start center" | "start unsafe start" | "start unsafe end" | "start unsafe center" | "start safe start" | "start safe end" | "start safe center" | "end normal" | "end stretch" | "end start" | "end end" | "end center" | "end unsafe start" | "end unsafe end" | "end unsafe center" | "end safe start" | "end safe end" | "end safe center" | "center normal" | "center stretch" | "center start" | "center end" | "center center" | "center unsafe start" | "center unsafe end" | "center unsafe center" | "center safe start" | "center safe end" | "center safe center" | "unsafe start normal" | "unsafe start stretch" | "unsafe start start" | "unsafe start end" | "unsafe start center" | "unsafe start unsafe start" | "unsafe start unsafe end" | "unsafe start unsafe center" | "unsafe start safe start" | "unsafe start safe end" | "unsafe start safe center" | "unsafe end normal" | "unsafe end stretch" | "unsafe end start" | "unsafe end end" | "unsafe end center" | "unsafe end unsafe start" | "unsafe end unsafe end" | "unsafe end unsafe center" | "unsafe end safe start" | "unsafe end safe end" | "unsafe end safe center" | "unsafe center normal" | "unsafe center stretch" | "unsafe center start" | "unsafe center end" | "unsafe center center" | "unsafe center unsafe start" | "unsafe center unsafe end" | "unsafe center unsafe center" | "unsafe center safe start" | "unsafe center safe end" | "unsafe center safe center" | "safe start normal" | "safe start stretch" | "safe start start" | "safe start end" | "safe start center" | "safe start unsafe start" | "safe start unsafe end" | "safe start unsafe center" | "safe start safe start" | "safe start safe end" | "safe start safe center" | "safe end normal" | "safe end stretch" | "safe end start" | "safe end end" | "safe end center" | "safe end unsafe start" | "safe end unsafe end" | "safe end unsafe center" | "safe end safe start" | "safe end safe end" | "safe end safe center" | "safe center normal" | "safe center stretch" | "safe center start" | "safe center end" | "safe center center" | "safe center unsafe start" | "safe center unsafe end" | "safe center unsafe center" | "safe center safe start" | "safe center safe end" | "safe center safe center" | | "normal space-between" | "normal space-around" | "normal space-evenly" | "baseline space-between" | "baseline space-around" | "baseline space-evenly" | "first baseline space-between" | "first baseline space-around" | "first baseline space-evenly" | "last baseline space-between" | "last baseline space-around" | "last baseline space-evenly" | "start space-between" | "start space-around" | "start space-evenly" | "end space-between" | "end space-around" | "end space-evenly" | "center space-between" | "center space-around" | "center space-evenly" | "unsafe start space-between" | "unsafe start space-around" | "unsafe start space-evenly" | "unsafe end space-between" | "unsafe end space-around" | "unsafe end space-evenly" | "unsafe center space-between" | "unsafe center space-around" | "unsafe center space-evenly" | "safe start space-between" | "safe start space-around" | "safe start space-evenly" | "safe end space-between" | "safe end space-around" | "safe end space-evenly" | "safe center space-between" | "safe center space-around" | "safe center space-evenly" | "stretch space-between" | "stretch space-around" | "stretch space-evenly" | "space-between normal" | "space-between start" | "space-between end" | "space-between center" | "space-between unsafe start" | "space-between unsafe end" | "space-between unsafe center" | "space-between safe start" | "space-between safe end" | "space-between safe center" | "space-between stretch" | "space-between space-between" | "space-between space-around" | "space-between space-evenly" | "space-around normal" | "space-around start" | "space-around end" | "space-around center" | "space-around unsafe start" | "space-around unsafe end" | "space-around unsafe center" | "space-around safe start" | "space-around safe end" | "space-around safe center" | "space-around stretch" | "space-around space-between" | "space-around space-around" | "space-around space-evenly" | "space-evenly normal" | "space-evenly start" | "space-evenly end" | "space-evenly center" | "space-evenly unsafe start" | "space-evenly unsafe end" | "space-evenly unsafe center" | "space-evenly safe start" | "space-evenly safe end" | "space-evenly safe center" | "space-evenly stretch" | "space-evenly space-between" | "space-evenly space-around" | "space-evenly space-evenly"
A shorthand property for
justify-content
andalign-content
.- Anchor to placeItemsplaceItems| "normal normal" | "normal stretch" | "normal baseline" | "normal first baseline" | "normal last baseline" | "normal start" | "normal end" | "normal center" | "normal unsafe start" | "normal unsafe end" | "normal unsafe center" | "normal safe start" | "normal safe end" | "normal safe center" | "stretch normal" | "stretch stretch" | "stretch baseline" | "stretch first baseline" | "stretch last baseline" | "stretch start" | "stretch end" | "stretch center" | "stretch unsafe start" | "stretch unsafe end" | "stretch unsafe center" | "stretch safe start" | "stretch safe end" | "stretch safe center" | "baseline normal" | "baseline stretch" | "baseline baseline" | "baseline first baseline" | "baseline last baseline" | "baseline start" | "baseline end" | "baseline center" | "baseline unsafe start" | "baseline unsafe end" | "baseline unsafe center" | "baseline safe start" | "baseline safe end" | "baseline safe center" | "first baseline normal" | "first baseline stretch" | "first baseline baseline" | "first baseline first baseline" | "first baseline last baseline" | "first baseline start" | "first baseline end" | "first baseline center" | "first baseline unsafe start" | "first baseline unsafe end" | "first baseline unsafe center" | "first baseline safe start" | "first baseline safe end" | "first baseline safe center" | "last baseline normal" | "last baseline stretch" | "last baseline baseline" | "last baseline first baseline" | "last baseline last baseline" | "last baseline start" | "last baseline end" | "last baseline center" | "last baseline unsafe start" | "last baseline unsafe end" | "last baseline unsafe center" | "last baseline safe start" | "last baseline safe end" | "last baseline safe center" | "start normal" | "start stretch" | "start baseline" | "start first baseline" | "start last baseline" | "start start" | "start end" | "start center" | "start unsafe start" | "start unsafe end" | "start unsafe center" | "start safe start" | "start safe end" | "start safe center" | "end normal" | "end stretch" | "end baseline" | "end first baseline" | "end last baseline" | "end start" | "end end" | "end center" | "end unsafe start" | "end unsafe end" | "end unsafe center" | "end safe start" | "end safe end" | "end safe center" | "center normal" | "center stretch" | "center baseline" | "center first baseline" | "center last baseline" | "center start" | "center end" | "center center" | "center unsafe start" | "center unsafe end" | "center unsafe center" | "center safe start" | "center safe end" | "center safe center" | "unsafe start normal" | "unsafe start stretch" | "unsafe start baseline" | "unsafe start first baseline" | "unsafe start last baseline" | "unsafe start start" | "unsafe start end" | "unsafe start center" | "unsafe start unsafe start" | "unsafe start unsafe end" | "unsafe start unsafe center" | "unsafe start safe start" | "unsafe start safe end" | "unsafe start safe center" | "unsafe end normal" | "unsafe end stretch" | "unsafe end baseline" | "unsafe end first baseline" | "unsafe end last baseline" | "unsafe end start" | "unsafe end end" | "unsafe end center" | "unsafe end unsafe start" | "unsafe end unsafe end" | "unsafe end unsafe center" | "unsafe end safe start" | "unsafe end safe end" | "unsafe end safe center" | "unsafe center normal" | "unsafe center stretch" | "unsafe center baseline" | "unsafe center first baseline" | "unsafe center last baseline" | "unsafe center start" | "unsafe center end" | "unsafe center center" | "unsafe center unsafe start" | "unsafe center unsafe end" | "unsafe center unsafe center" | "unsafe center safe start" | "unsafe center safe end" | "unsafe center safe center" | "safe start normal" | "safe start stretch" | "safe start baseline" | "safe start first baseline" | "safe start last baseline" | "safe start start" | "safe start end" | "safe start center" | "safe start unsafe start" | "safe start unsafe end" | "safe start unsafe center" | "safe start safe start" | "safe start safe end" | "safe start safe center" | "safe end normal" | "safe end stretch" | "safe end baseline" | "safe end first baseline" | "safe end last baseline" | "safe end start" | "safe end end" | "safe end center" | "safe end unsafe start" | "safe end unsafe end" | "safe end unsafe center" | "safe end safe start" | "safe end safe end" | "safe end safe center" | "safe center normal" | "safe center stretch" | "safe center baseline" | "safe center first baseline" | "safe center last baseline" | "safe center start" | "safe center end" | "safe center center" | "safe center unsafe start" | "safe center unsafe end" | "safe center unsafe center" | "safe center safe start" | "safe center safe end" | "safe center safe center"
A shorthand property for
justify-items
andalign-items
.- Anchor to rowGaprowGap<"" | >
Adjust spacing between elements in the block axis.
This overrides the row value of
gap
.either accepts: * a single SpacingKeyword value (e.g.
large-100
) *OR a container query string with supported SpacingKeyword values as query values (e.g. @container (inline-size > 500px) large-300, small-300)
Grid
- accessibilityLabel
A label that describes the purpose or contents of the element. When set, it will be announced to users using assistive technologies and will provide them with more context. Only use this when the element's content is not enough context for users using assistive technologies.
string
- accessibilityRole
Sets the semantic meaning of the component’s content. When set, the role will be used by assistive technologies to help users navigate the page.
AccessibilityRole
- accessibilityVisibility
Changes the visibility of the element. - `visible`: the element is visible to all users. - `hidden`: the element is removed from the accessibility tree but remains visible. - `exclusive`: the element is visually hidden but remains in the accessibility tree.
"visible" | "hidden" | "exclusive"
- adoptedCallback
() => void
- alignContent
Aligns the grid along the block (column) axis. This overrides the block value of `placeContent`.
"" | AlignContentKeyword
- alignItems
Aligns the grid items along the block (column) axis. This overrides the block value of `placeItems`.
"" | AlignItemsKeyword
- attributeChangedCallback
(name: string) => void
- background
Adjust the background of the element.
BackgroundColorKeyword
- blockSize
Adjust the block size.
SizeUnitsOrAuto
- border
Set the border via the shorthand property. This can be a size, optionally followed by a color, optionally followed by a style. If the color is not specified, it will be `base`. If the style is not specified, it will be `auto`. Values can be overridden by `borderWidth`, `borderStyle`, and `borderColor`.
BorderShorthand
- borderColor
Set the color of the border. If set, it takes precedence over the `border` property's color.
"" | ColorKeyword
- borderRadius
Set the radius of the border. [1-to-4-value syntax](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#edges_of_a_box) is supported. Note that, contrary to the CSS, it uses flow-relative values and the order is: - 4 values: `start-start start-end end-end end-start` - 3 values: `start-start (start-end & end-start) start-end` - 2 values: `(start-start & end-end) (start-end & end-start)` For example: - `small-100` means start-start, start-end, end-end and end-start border radii are `small-100`. - `small-100 none` means start-start and end-end border radii are `small-100`, start-end and end-start border radii are `none`. - `small-100 none large-100` means start-start border radius is `small-100`, start-end border radius is `none`, end-end border radius is `large-100` and end-start border radius is `none`. - `small-100 none large-100 small-100` means start-start border radius is `small-100`, start-end border radius is `none`, end-end border radius is `large-100` and end-start border radius is `small-100`.
MaybeAllValuesShorthandProperty<BoxBorderRadii>
- borderStyle
Set the style of the border. If set, it takes precedence over the `border` property's style. Like CSS, up to 4 values can be specified. If one value is specified, it applies to all sides. If two values are specified, they apply to the block sides and inline sides respectively. If three values are specified, they apply to the block-start, both inline sides, and block-end respectively. If four values are specified, they apply to the block-start, block-end, inline-start, and inline-end sides respectively.
"" | MaybeAllValuesShorthandProperty<BoxBorderStyles>
- borderWidth
Set the width of the border. If set, it takes precedence over the `border` property's width. Like CSS, up to 4 values can be specified. If one value is specified, it applies to all sides. If two values are specified, they apply to the block sides and inline sides respectively. If three values are specified, they apply to the block-start, both inline sides, and block-end respectively. If four values are specified, they apply to the block-start, block-end, inline-start, and inline-end sides respectively.
"" | MaybeAllValuesShorthandProperty<"small" | "small-100" | "base" | "large" | "large-100" | "none">
- click
Like the standard `element.click()`, but you can influence the behavior with a `sourceEvent`. For example, if the `sourceEvent` was a middle click, or has particular keys held down, components will attempt to produce the desired behavior on links, such as opening the page in the background tab.
({ sourceEvent }?: ClickOptions) => void
- columnGap
Adjust spacing between elements in the inline axis. This overrides the column value of `gap`. `columnGap` either accepts: * a single SpacingKeyword value (e.g. `large-100`) * OR a container query string with supported SpacingKeyword values as query values (e.g. @container (inline-size > 500px) large-300, small-300)
MakeResponsive<"" | SpacingKeyword>
- connectedCallback
() => void
- disconnectedCallback
() => void
- display
Sets the outer display type of the component. The outer type sets a component's participation in [flow layout](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flow_layout). - `auto` the component's initial value. The actual value depends on the component and context. - `none` hides the component from display and removes it from the accessibility tree, making it invisible to screen readers.
MakeResponsive<"auto" | "none">
- gap
Adjust spacing between elements. `gap` can either accept: * a single SpacingKeyword value applied to both axes (e.g. `large-100`). *OR a pair of values (eg `large-100 large-500`) can be used to set the inline and block axes respectively. OR a container query string with supported SpacingKeyword values as query values (e.g.@container (inline-size > 500px) large-300, small-300)
MakeResponsive<MaybeTwoValuesShorthandProperty<SpacingKeyword>>
- gridTemplateColumns
Define columns and specify their size.
string
- gridTemplateRows
Define rows and specify their size.
string
- inlineSize
Adjust the inline size.
SizeUnitsOrAuto
- justifyContent
Aligns the grid along the inline (row) axis. This overrides the inline value of `placeContent`.
"" | JustifyContentKeyword
- justifyItems
Aligns the grid items along the inline (row) axis. This overrides the inline value of `placeItems`.
"" | JustifyItemsKeyword
- maxBlockSize
Adjust the maximum block size.
SizeUnitsOrNone
- maxInlineSize
Adjust the maximum inline size.
SizeUnitsOrNone
- minBlockSize
Adjust the minimum block size.
SizeUnits
- minInlineSize
Adjust the minimum inline size.
SizeUnits
- overflow
Sets the overflow behavior of the element. - `hidden`: clips the content when it is larger than the element’s container. The element will not be scrollable and the users will not be able to access the clipped content by dragging or using a scroll wheel on a mouse. - `visible`: the content that extends beyond the element’s container is visible.
"visible" | "hidden"
- padding
Adjust the padding of all edges. 1-to-4-value syntax (@see https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#edges_of_a_box) is supported. Note that, contrary to the CSS, it uses flow-relative values and the order is: - 4 values: `block-start inline-end block-end inline-start` - 3 values: `block-start inline block-end` - 2 values: `block inline` For example: - `large` means block-start, inline-end, block-end and inline-start paddings are `large`. - `large none` means block-start and block-end paddings are `large`, inline-start and inline-end paddings are `none`. - `large none large` means block-start padding is `large`, inline-end padding is `none`, block-end padding is `large` and inline-start padding is `none`. - `large none large small` means block-start padding is `large`, inline-end padding is `none`, block-end padding is `large` and inline-start padding is `small`. A padding value of `auto` will use the default padding for the closest container that has had its usual padding removed. `padding` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This also accepts up to 4 values (e.g. `@container (inline-size > 500px) large-300 small-300 large-100 small-100, small-200`)
MakeResponsive<MaybeAllValuesShorthandProperty<PaddingKeyword>>
- paddingBlock
Adjust the block-padding. - `large none` means block-start padding is `large`, block-end padding is `none`. This overrides the block value of `padding`. `paddingBlock` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This also accepts up to 2 values (e.g. `@container (inline-size > 500px) large-300 small-300, small-200`)
MakeResponsive<"" | MaybeTwoValuesShorthandProperty<PaddingKeyword>>
- paddingBlockEnd
Adjust the block-end padding. This overrides the block-end value of `paddingBlock`. `paddingBlockEnd` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This only accepts up to 1 value per predicate (e.g. `@container (inline-size > 500px) large-300, small-200`)
MakeResponsive<"" | PaddingKeyword>
- paddingBlockStart
Adjust the block-start padding. This overrides the block-start value of `paddingBlock`. `paddingBlockStart` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This only accepts 1 value per predicate (e.g. `@container (inline-size > 500px) large-300, small-200`)
MakeResponsive<"" | PaddingKeyword>
- paddingInline
Adjust the inline padding. - `large none` means inline-start padding is `large`, inline-end padding is `none`. This overrides the inline value of `padding`. `paddingInline` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This also accepts up to 2 values (e.g. `@container (inline-size > 500px) large-300 small-300, small-200`)
MakeResponsive<"" | MaybeTwoValuesShorthandProperty<PaddingKeyword>>
- paddingInlineEnd
Adjust the inline-end padding. This overrides the inline-end value of `paddingInline`. `paddingInlineEnd` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This only accepts 1 value per predicate (e.g. `@container (inline-size > 500px) large-300, small-200`)
MakeResponsive<"" | PaddingKeyword>
- paddingInlineStart
Adjust the inline-start padding. This overrides the inline-start value of `paddingInline`. `paddingInlineStart` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This only accepts 1 value per predicate (e.g. `@container (inline-size > 500px) large-300, small-200`)
MakeResponsive<"" | PaddingKeyword>
- placeContent
A shorthand property for `justify-content` and `align-content`.
"normal normal" | "normal stretch" | "normal start" | "normal end" | "normal center" | "normal unsafe start" | "normal unsafe end" | "normal unsafe center" | "normal safe start" | "normal safe end" | "normal safe center" | "stretch normal" | "stretch stretch" | "stretch start" | "stretch end" | "stretch center" | "stretch unsafe start" | "stretch unsafe end" | "stretch unsafe center" | "stretch safe start" | "stretch safe end" | "stretch safe center" | "baseline normal" | "baseline stretch" | "baseline start" | "baseline end" | "baseline center" | "baseline unsafe start" | "baseline unsafe end" | "baseline unsafe center" | "baseline safe start" | "baseline safe end" | "baseline safe center" | "first baseline normal" | "first baseline stretch" | "first baseline start" | "first baseline end" | "first baseline center" | "first baseline unsafe start" | "first baseline unsafe end" | "first baseline unsafe center" | "first baseline safe start" | "first baseline safe end" | "first baseline safe center" | "last baseline normal" | "last baseline stretch" | "last baseline start" | "last baseline end" | "last baseline center" | "last baseline unsafe start" | "last baseline unsafe end" | "last baseline unsafe center" | "last baseline safe start" | "last baseline safe end" | "last baseline safe center" | "start normal" | "start stretch" | "start start" | "start end" | "start center" | "start unsafe start" | "start unsafe end" | "start unsafe center" | "start safe start" | "start safe end" | "start safe center" | "end normal" | "end stretch" | "end start" | "end end" | "end center" | "end unsafe start" | "end unsafe end" | "end unsafe center" | "end safe start" | "end safe end" | "end safe center" | "center normal" | "center stretch" | "center start" | "center end" | "center center" | "center unsafe start" | "center unsafe end" | "center unsafe center" | "center safe start" | "center safe end" | "center safe center" | "unsafe start normal" | "unsafe start stretch" | "unsafe start start" | "unsafe start end" | "unsafe start center" | "unsafe start unsafe start" | "unsafe start unsafe end" | "unsafe start unsafe center" | "unsafe start safe start" | "unsafe start safe end" | "unsafe start safe center" | "unsafe end normal" | "unsafe end stretch" | "unsafe end start" | "unsafe end end" | "unsafe end center" | "unsafe end unsafe start" | "unsafe end unsafe end" | "unsafe end unsafe center" | "unsafe end safe start" | "unsafe end safe end" | "unsafe end safe center" | "unsafe center normal" | "unsafe center stretch" | "unsafe center start" | "unsafe center end" | "unsafe center center" | "unsafe center unsafe start" | "unsafe center unsafe end" | "unsafe center unsafe center" | "unsafe center safe start" | "unsafe center safe end" | "unsafe center safe center" | "safe start normal" | "safe start stretch" | "safe start start" | "safe start end" | "safe start center" | "safe start unsafe start" | "safe start unsafe end" | "safe start unsafe center" | "safe start safe start" | "safe start safe end" | "safe start safe center" | "safe end normal" | "safe end stretch" | "safe end start" | "safe end end" | "safe end center" | "safe end unsafe start" | "safe end unsafe end" | "safe end unsafe center" | "safe end safe start" | "safe end safe end" | "safe end safe center" | "safe center normal" | "safe center stretch" | "safe center start" | "safe center end" | "safe center center" | "safe center unsafe start" | "safe center unsafe end" | "safe center unsafe center" | "safe center safe start" | "safe center safe end" | "safe center safe center" | AlignContentKeyword | "normal space-between" | "normal space-around" | "normal space-evenly" | "baseline space-between" | "baseline space-around" | "baseline space-evenly" | "first baseline space-between" | "first baseline space-around" | "first baseline space-evenly" | "last baseline space-between" | "last baseline space-around" | "last baseline space-evenly" | "start space-between" | "start space-around" | "start space-evenly" | "end space-between" | "end space-around" | "end space-evenly" | "center space-between" | "center space-around" | "center space-evenly" | "unsafe start space-between" | "unsafe start space-around" | "unsafe start space-evenly" | "unsafe end space-between" | "unsafe end space-around" | "unsafe end space-evenly" | "unsafe center space-between" | "unsafe center space-around" | "unsafe center space-evenly" | "safe start space-between" | "safe start space-around" | "safe start space-evenly" | "safe end space-between" | "safe end space-around" | "safe end space-evenly" | "safe center space-between" | "safe center space-around" | "safe center space-evenly" | "stretch space-between" | "stretch space-around" | "stretch space-evenly" | "space-between normal" | "space-between start" | "space-between end" | "space-between center" | "space-between unsafe start" | "space-between unsafe end" | "space-between unsafe center" | "space-between safe start" | "space-between safe end" | "space-between safe center" | "space-between stretch" | "space-between space-between" | "space-between space-around" | "space-between space-evenly" | "space-around normal" | "space-around start" | "space-around end" | "space-around center" | "space-around unsafe start" | "space-around unsafe end" | "space-around unsafe center" | "space-around safe start" | "space-around safe end" | "space-around safe center" | "space-around stretch" | "space-around space-between" | "space-around space-around" | "space-around space-evenly" | "space-evenly normal" | "space-evenly start" | "space-evenly end" | "space-evenly center" | "space-evenly unsafe start" | "space-evenly unsafe end" | "space-evenly unsafe center" | "space-evenly safe start" | "space-evenly safe end" | "space-evenly safe center" | "space-evenly stretch" | "space-evenly space-between" | "space-evenly space-around" | "space-evenly space-evenly"
- placeItems
A shorthand property for `justify-items` and `align-items`.
AlignItemsKeyword | "normal normal" | "normal stretch" | "normal baseline" | "normal first baseline" | "normal last baseline" | "normal start" | "normal end" | "normal center" | "normal unsafe start" | "normal unsafe end" | "normal unsafe center" | "normal safe start" | "normal safe end" | "normal safe center" | "stretch normal" | "stretch stretch" | "stretch baseline" | "stretch first baseline" | "stretch last baseline" | "stretch start" | "stretch end" | "stretch center" | "stretch unsafe start" | "stretch unsafe end" | "stretch unsafe center" | "stretch safe start" | "stretch safe end" | "stretch safe center" | "baseline normal" | "baseline stretch" | "baseline baseline" | "baseline first baseline" | "baseline last baseline" | "baseline start" | "baseline end" | "baseline center" | "baseline unsafe start" | "baseline unsafe end" | "baseline unsafe center" | "baseline safe start" | "baseline safe end" | "baseline safe center" | "first baseline normal" | "first baseline stretch" | "first baseline baseline" | "first baseline first baseline" | "first baseline last baseline" | "first baseline start" | "first baseline end" | "first baseline center" | "first baseline unsafe start" | "first baseline unsafe end" | "first baseline unsafe center" | "first baseline safe start" | "first baseline safe end" | "first baseline safe center" | "last baseline normal" | "last baseline stretch" | "last baseline baseline" | "last baseline first baseline" | "last baseline last baseline" | "last baseline start" | "last baseline end" | "last baseline center" | "last baseline unsafe start" | "last baseline unsafe end" | "last baseline unsafe center" | "last baseline safe start" | "last baseline safe end" | "last baseline safe center" | "start normal" | "start stretch" | "start baseline" | "start first baseline" | "start last baseline" | "start start" | "start end" | "start center" | "start unsafe start" | "start unsafe end" | "start unsafe center" | "start safe start" | "start safe end" | "start safe center" | "end normal" | "end stretch" | "end baseline" | "end first baseline" | "end last baseline" | "end start" | "end end" | "end center" | "end unsafe start" | "end unsafe end" | "end unsafe center" | "end safe start" | "end safe end" | "end safe center" | "center normal" | "center stretch" | "center baseline" | "center first baseline" | "center last baseline" | "center start" | "center end" | "center center" | "center unsafe start" | "center unsafe end" | "center unsafe center" | "center safe start" | "center safe end" | "center safe center" | "unsafe start normal" | "unsafe start stretch" | "unsafe start baseline" | "unsafe start first baseline" | "unsafe start last baseline" | "unsafe start start" | "unsafe start end" | "unsafe start center" | "unsafe start unsafe start" | "unsafe start unsafe end" | "unsafe start unsafe center" | "unsafe start safe start" | "unsafe start safe end" | "unsafe start safe center" | "unsafe end normal" | "unsafe end stretch" | "unsafe end baseline" | "unsafe end first baseline" | "unsafe end last baseline" | "unsafe end start" | "unsafe end end" | "unsafe end center" | "unsafe end unsafe start" | "unsafe end unsafe end" | "unsafe end unsafe center" | "unsafe end safe start" | "unsafe end safe end" | "unsafe end safe center" | "unsafe center normal" | "unsafe center stretch" | "unsafe center baseline" | "unsafe center first baseline" | "unsafe center last baseline" | "unsafe center start" | "unsafe center end" | "unsafe center center" | "unsafe center unsafe start" | "unsafe center unsafe end" | "unsafe center unsafe center" | "unsafe center safe start" | "unsafe center safe end" | "unsafe center safe center" | "safe start normal" | "safe start stretch" | "safe start baseline" | "safe start first baseline" | "safe start last baseline" | "safe start start" | "safe start end" | "safe start center" | "safe start unsafe start" | "safe start unsafe end" | "safe start unsafe center" | "safe start safe start" | "safe start safe end" | "safe start safe center" | "safe end normal" | "safe end stretch" | "safe end baseline" | "safe end first baseline" | "safe end last baseline" | "safe end start" | "safe end end" | "safe end center" | "safe end unsafe start" | "safe end unsafe end" | "safe end unsafe center" | "safe end safe start" | "safe end safe end" | "safe end safe center" | "safe center normal" | "safe center stretch" | "safe center baseline" | "safe center first baseline" | "safe center last baseline" | "safe center start" | "safe center end" | "safe center center" | "safe center unsafe start" | "safe center unsafe end" | "safe center unsafe center" | "safe center safe start" | "safe center safe end" | "safe center safe center"
- queueRender
Queue a run of the render function. You shouldn't need to call this manually - it should be handled by changes to @property values.
() => void
- rowGap
Adjust spacing between elements in the block axis. This overrides the row value of `gap`. `rowGap` either accepts: * a single SpacingKeyword value (e.g. `large-100`) *OR a container query string with supported SpacingKeyword values as query values (e.g. @container (inline-size > 500px) large-300, small-300)
MakeResponsive<"" | SpacingKeyword>
- setAttribute
(name: string, value: string) => void
declare class Grid extends BoxElement implements GridProps {
constructor();
accessor gridTemplateColumns: GridProps['gridTemplateColumns'];
accessor gridTemplateRows: GridProps['gridTemplateRows'];
accessor justifyItems: GridProps['justifyItems'];
accessor alignItems: GridProps['alignItems'];
accessor placeItems: GridProps['placeItems'];
accessor justifyContent: GridProps['justifyContent'];
accessor alignContent: GridProps['alignContent'];
accessor placeContent: GridProps['placeContent'];
accessor gap: GridProps['gap'];
accessor rowGap: GridProps['rowGap'];
accessor columnGap: GridProps['columnGap'];
}
JustifyItemsKeyword
Justify items defines the default justify-self for all items of the box, giving them all a default way of justifying each box along the appropriate axis.
'normal' | 'stretch' | BaselinePosition | OverflowPosition | ContentPosition
BaselinePosition
'baseline' | 'first baseline' | 'last baseline'
OverflowPosition
`unsafe ${ContentPosition}` | `safe ${ContentPosition}`
ContentPosition
'center' | 'start' | 'end'
AlignItemsKeyword
Align items sets the align-self value on all direct children as a group.
'normal' | 'stretch' | BaselinePosition | OverflowPosition | ContentPosition
JustifyContentKeyword
Justify content defines how the browser distributes space between and around content items along the main-axis of a flex container, and the inline axis of a grid container.
'normal' | ContentDistribution | OverflowPosition | ContentPosition
ContentDistribution
'space-between' | 'space-around' | 'space-evenly' | 'stretch'
AlignContentKeyword
Align content sets the distribution of space between and around content items along a flexbox's cross axis, or a grid or block-level element's block axis.
'normal' | BaselinePosition | ContentDistribution | OverflowPosition | ContentPosition
MakeResponsive
T | `@container${string}`
MaybeTwoValuesShorthandProperty
T | `${T} ${T}`
SpacingKeyword
SizeKeyword | 'none'
SizeKeyword
'small-500' | 'small-400' | 'small-300' | 'small-200' | 'small-100' | 'small' | 'base' | 'large' | 'large-100' | 'large-200' | 'large-300' | 'large-400' | 'large-500'
AccessibilityRole
'main' | 'header' | 'footer' | 'section' | 'aside' | 'navigation' | 'ordered-list' | 'list-item' | 'list-item-separator' | 'unordered-list' | 'separator' | 'status' | 'alert' | 'generic' | 'presentation' | 'none'
BackgroundColorKeyword
'transparent' | ColorKeyword
ColorKeyword
'subdued' | 'base' | 'strong'
SizeUnitsOrAuto
SizeUnits | 'auto'
SizeUnits
`${number}px` | `${number}%` | `0`
SizeUnitsOrNone
SizeUnits | 'none'
MaybeAllValuesShorthandProperty
T | `${T} ${T}` | `${T} ${T} ${T}` | `${T} ${T} ${T} ${T}`
PaddingKeyword
SizeKeyword | 'none'
BorderShorthand
Represents a shorthand for defining a border. It can be a combination of size, optionally followed by color, optionally followed by style.
BorderSizeKeyword | `${BorderSizeKeyword} ${ColorKeyword}` | `${BorderSizeKeyword} ${ColorKeyword} ${BorderStyleKeyword}`
BorderSizeKeyword
SizeKeyword | 'none'
BorderStyleKeyword
'none' | 'solid' | 'dashed' | 'dotted' | 'auto'
BoxBorderStyles
'auto' | 'none' | 'solid' | 'dashed'
BoxBorderRadii
'small' | 'small-200' | 'small-100' | 'base' | 'large' | 'large-100' | 'large-200' | 'none'
ClickOptions
- sourceEvent
The event you want to influence the synthetic click.
ActivationEventEsque
export interface ClickOptions {
/**
* The event you want to influence the synthetic click.
*/
sourceEvent?: ActivationEventEsque;
}
ActivationEventEsque
- button
number
- ctrlKey
boolean
- metaKey
boolean
- shiftKey
boolean
export interface ActivationEventEsque {
shiftKey: boolean;
metaKey: boolean;
ctrlKey: boolean;
button: number;
}
Anchor to griditemGridItem
Display content within a single item of a grid layout.
- Anchor to accessibilityLabelaccessibilityLabelstring
A label that describes the purpose or contents of the element. When set, it will be announced to users using assistive technologies and will provide them with more context.
Only use this when the element's content is not enough context for users using assistive technologies.
- Anchor to accessibilityRoleaccessibilityRole
Sets the semantic meaning of the component’s content. When set, the role will be used by assistive technologies to help users navigate the page.
- Anchor to accessibilityVisibilityaccessibilityVisibility"visible" | "hidden" | "exclusive"
Changes the visibility of the element.
visible
: the element is visible to all users.hidden
: the element is removed from the accessibility tree but remains visible.exclusive
: the element is visually hidden but remains in the accessibility tree.
- Anchor to backgroundbackground
Adjust the background of the element.
- Anchor to blockSizeblockSize
Adjust the block size.
- Anchor to borderborder
Set the border via the shorthand property.
This can be a size, optionally followed by a color, optionally followed by a style.
If the color is not specified, it will be
base
.If the style is not specified, it will be
auto
.Values can be overridden by
,
, and
.
- Anchor to borderColorborderColor"" |
Set the color of the border.
If set, it takes precedence over the
border
property's color.- Anchor to borderRadiusborderRadius<>
Set the radius of the border.
1-to-4-value syntax is supported. Note that, contrary to the CSS, it uses flow-relative values and the order is:
- 4 values:
start-start start-end end-end end-start
- 3 values:
start-start (start-end & end-start) start-end
- 2 values:
(start-start & end-end) (start-end & end-start)
For example:
small-100
means start-start, start-end, end-end and end-start border radii aresmall-100
.small-100 none
means start-start and end-end border radii aresmall-100
, start-end and end-start border radii arenone
.small-100 none large-100
means start-start border radius issmall-100
, start-end border radius isnone
, end-end border radius islarge-100
and end-start border radius isnone
.small-100 none large-100 small-100
means start-start border radius issmall-100
, start-end border radius isnone
, end-end border radius islarge-100
and end-start border radius issmall-100
.
- 4 values:
- Anchor to borderStyleborderStyle"" | <>
Set the style of the border.
If set, it takes precedence over the
border
property's style.Like CSS, up to 4 values can be specified.
If one value is specified, it applies to all sides.
If two values are specified, they apply to the block sides and inline sides respectively.
If three values are specified, they apply to the block-start, both inline sides, and block-end respectively.
If four values are specified, they apply to the block-start, block-end, inline-start, and inline-end sides respectively.
- Anchor to borderWidthborderWidth"" | <"small" | "small-100" | "base" | "large" | "large-100" | "none">
Set the width of the border.
If set, it takes precedence over the
border
property's width.Like CSS, up to 4 values can be specified.
If one value is specified, it applies to all sides.
If two values are specified, they apply to the block sides and inline sides respectively.
If three values are specified, they apply to the block-start, both inline sides, and block-end respectively.
If four values are specified, they apply to the block-start, block-end, inline-start, and inline-end sides respectively.
- Anchor to displaydisplay<"auto" | "none">
Sets the outer display type of the component. The outer type sets a component's participation in flow layout.
auto
the component's initial value. The actual value depends on the component and context.none
hides the component from display and removes it from the accessibility tree, making it invisible to screen readers.
- Anchor to gridColumngridColumn"auto" | `span ${number}`
Number of columns the item will span across
- Anchor to gridRowgridRow"auto" | `span ${number}`
Number of rows the item will span across
- Anchor to inlineSizeinlineSize
Adjust the inline size.
- Anchor to maxBlockSizemaxBlockSize
Adjust the maximum block size.
- Anchor to maxInlineSizemaxInlineSize
Adjust the maximum inline size.
- Anchor to minBlockSizeminBlockSize
Adjust the minimum block size.
- Anchor to minInlineSizeminInlineSize
Adjust the minimum inline size.
- Anchor to overflowoverflow"visible" | "hidden"
Sets the overflow behavior of the element.
hidden
: clips the content when it is larger than the element’s container. The element will not be scrollable and the users will not be able to access the clipped content by dragging or using a scroll wheel on a mouse.visible
: the content that extends beyond the element’s container is visible.
- Anchor to paddingpadding<<>>
Adjust the padding of all edges.
1-to-4-value syntax (@see https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#edges_of_a_box) is supported. Note that, contrary to the CSS, it uses flow-relative values and the order is:
- 4 values:
block-start inline-end block-end inline-start
- 3 values:
block-start inline block-end
- 2 values:
block inline
For example:
large
means block-start, inline-end, block-end and inline-start paddings arelarge
.large none
means block-start and block-end paddings arelarge
, inline-start and inline-end paddings arenone
.large none large
means block-start padding islarge
, inline-end padding isnone
, block-end padding islarge
and inline-start padding isnone
.large none large small
means block-start padding islarge
, inline-end padding isnone
, block-end padding islarge
and inline-start padding issmall
.
A padding value of
auto
will use the default padding for the closest container that has had its usual padding removed.padding
also accepts a container query string with the supported PaddingKeyword as a query value e.g. (@container (inline-size > 500px) large-300, small-300
)This also accepts up to 4 values (e.g.
@container (inline-size > 500px) large-300 small-300 large-100 small-100, small-200
)- 4 values:
- Anchor to paddingBlockpaddingBlock<"" | <>>
Adjust the block-padding.
large none
means block-start padding islarge
, block-end padding isnone
.
This overrides the block value of
padding
.also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
)This also accepts up to 2 values (e.g.
@container (inline-size > 500px) large-300 small-300, small-200
)- Anchor to paddingBlockEndpaddingBlockEnd<"" | >
Adjust the block-end padding.
This overrides the block-end value of
.
also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
)This only accepts up to 1 value per predicate (e.g.
@container (inline-size > 500px) large-300, small-200
)- Anchor to paddingBlockStartpaddingBlockStart<"" | >
Adjust the block-start padding.
This overrides the block-start value of
.
also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
)This only accepts 1 value per predicate (e.g.
@container (inline-size > 500px) large-300, small-200
)- Anchor to paddingInlinepaddingInline<"" | <>>
Adjust the inline padding.
large none
means inline-start padding islarge
, inline-end padding isnone
.
This overrides the inline value of
padding
.also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
)This also accepts up to 2 values (e.g.
@container (inline-size > 500px) large-300 small-300, small-200
)- Anchor to paddingInlineEndpaddingInlineEnd<"" | >
Adjust the inline-end padding.
This overrides the inline-end value of
.
also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
) This only accepts 1 value per predicate (e.g.@container (inline-size > 500px) large-300, small-200
)- Anchor to paddingInlineStartpaddingInlineStart<"" | >
Adjust the inline-start padding.
This overrides the inline-start value of
.
also accepts a container query string with the supported PaddingKeyword as a query value e.g. (
@container (inline-size > 500px) large-300, small-300
) This only accepts 1 value per predicate (e.g.@container (inline-size > 500px) large-300, small-200
)
GridItem
- accessibilityLabel
A label that describes the purpose or contents of the element. When set, it will be announced to users using assistive technologies and will provide them with more context. Only use this when the element's content is not enough context for users using assistive technologies.
string
- accessibilityRole
Sets the semantic meaning of the component’s content. When set, the role will be used by assistive technologies to help users navigate the page.
AccessibilityRole
- accessibilityVisibility
Changes the visibility of the element. - `visible`: the element is visible to all users. - `hidden`: the element is removed from the accessibility tree but remains visible. - `exclusive`: the element is visually hidden but remains in the accessibility tree.
"visible" | "hidden" | "exclusive"
- adoptedCallback
() => void
- attributeChangedCallback
(name: string) => void
- background
Adjust the background of the element.
BackgroundColorKeyword
- blockSize
Adjust the block size.
SizeUnitsOrAuto
- border
Set the border via the shorthand property. This can be a size, optionally followed by a color, optionally followed by a style. If the color is not specified, it will be `base`. If the style is not specified, it will be `auto`. Values can be overridden by `borderWidth`, `borderStyle`, and `borderColor`.
BorderShorthand
- borderColor
Set the color of the border. If set, it takes precedence over the `border` property's color.
"" | ColorKeyword
- borderRadius
Set the radius of the border. [1-to-4-value syntax](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#edges_of_a_box) is supported. Note that, contrary to the CSS, it uses flow-relative values and the order is: - 4 values: `start-start start-end end-end end-start` - 3 values: `start-start (start-end & end-start) start-end` - 2 values: `(start-start & end-end) (start-end & end-start)` For example: - `small-100` means start-start, start-end, end-end and end-start border radii are `small-100`. - `small-100 none` means start-start and end-end border radii are `small-100`, start-end and end-start border radii are `none`. - `small-100 none large-100` means start-start border radius is `small-100`, start-end border radius is `none`, end-end border radius is `large-100` and end-start border radius is `none`. - `small-100 none large-100 small-100` means start-start border radius is `small-100`, start-end border radius is `none`, end-end border radius is `large-100` and end-start border radius is `small-100`.
MaybeAllValuesShorthandProperty<BoxBorderRadii>
- borderStyle
Set the style of the border. If set, it takes precedence over the `border` property's style. Like CSS, up to 4 values can be specified. If one value is specified, it applies to all sides. If two values are specified, they apply to the block sides and inline sides respectively. If three values are specified, they apply to the block-start, both inline sides, and block-end respectively. If four values are specified, they apply to the block-start, block-end, inline-start, and inline-end sides respectively.
"" | MaybeAllValuesShorthandProperty<BoxBorderStyles>
- borderWidth
Set the width of the border. If set, it takes precedence over the `border` property's width. Like CSS, up to 4 values can be specified. If one value is specified, it applies to all sides. If two values are specified, they apply to the block sides and inline sides respectively. If three values are specified, they apply to the block-start, both inline sides, and block-end respectively. If four values are specified, they apply to the block-start, block-end, inline-start, and inline-end sides respectively.
"" | MaybeAllValuesShorthandProperty<"small" | "small-100" | "base" | "large" | "large-100" | "none">
- click
Like the standard `element.click()`, but you can influence the behavior with a `sourceEvent`. For example, if the `sourceEvent` was a middle click, or has particular keys held down, components will attempt to produce the desired behavior on links, such as opening the page in the background tab.
({ sourceEvent }?: ClickOptions) => void
- connectedCallback
() => void
- disconnectedCallback
() => void
- display
Sets the outer display type of the component. The outer type sets a component's participation in [flow layout](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flow_layout). - `auto` the component's initial value. The actual value depends on the component and context. - `none` hides the component from display and removes it from the accessibility tree, making it invisible to screen readers.
MakeResponsive<"auto" | "none">
- gridColumn
Number of columns the item will span across
"auto" | `span ${number}`
- gridRow
Number of rows the item will span across
"auto" | `span ${number}`
- inlineSize
Adjust the inline size.
SizeUnitsOrAuto
- maxBlockSize
Adjust the maximum block size.
SizeUnitsOrNone
- maxInlineSize
Adjust the maximum inline size.
SizeUnitsOrNone
- minBlockSize
Adjust the minimum block size.
SizeUnits
- minInlineSize
Adjust the minimum inline size.
SizeUnits
- overflow
Sets the overflow behavior of the element. - `hidden`: clips the content when it is larger than the element’s container. The element will not be scrollable and the users will not be able to access the clipped content by dragging or using a scroll wheel on a mouse. - `visible`: the content that extends beyond the element’s container is visible.
"visible" | "hidden"
- padding
Adjust the padding of all edges. 1-to-4-value syntax (@see https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties#edges_of_a_box) is supported. Note that, contrary to the CSS, it uses flow-relative values and the order is: - 4 values: `block-start inline-end block-end inline-start` - 3 values: `block-start inline block-end` - 2 values: `block inline` For example: - `large` means block-start, inline-end, block-end and inline-start paddings are `large`. - `large none` means block-start and block-end paddings are `large`, inline-start and inline-end paddings are `none`. - `large none large` means block-start padding is `large`, inline-end padding is `none`, block-end padding is `large` and inline-start padding is `none`. - `large none large small` means block-start padding is `large`, inline-end padding is `none`, block-end padding is `large` and inline-start padding is `small`. A padding value of `auto` will use the default padding for the closest container that has had its usual padding removed. `padding` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This also accepts up to 4 values (e.g. `@container (inline-size > 500px) large-300 small-300 large-100 small-100, small-200`)
MakeResponsive<MaybeAllValuesShorthandProperty<PaddingKeyword>>
- paddingBlock
Adjust the block-padding. - `large none` means block-start padding is `large`, block-end padding is `none`. This overrides the block value of `padding`. `paddingBlock` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This also accepts up to 2 values (e.g. `@container (inline-size > 500px) large-300 small-300, small-200`)
MakeResponsive<"" | MaybeTwoValuesShorthandProperty<PaddingKeyword>>
- paddingBlockEnd
Adjust the block-end padding. This overrides the block-end value of `paddingBlock`. `paddingBlockEnd` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This only accepts up to 1 value per predicate (e.g. `@container (inline-size > 500px) large-300, small-200`)
MakeResponsive<"" | PaddingKeyword>
- paddingBlockStart
Adjust the block-start padding. This overrides the block-start value of `paddingBlock`. `paddingBlockStart` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This only accepts 1 value per predicate (e.g. `@container (inline-size > 500px) large-300, small-200`)
MakeResponsive<"" | PaddingKeyword>
- paddingInline
Adjust the inline padding. - `large none` means inline-start padding is `large`, inline-end padding is `none`. This overrides the inline value of `padding`. `paddingInline` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This also accepts up to 2 values (e.g. `@container (inline-size > 500px) large-300 small-300, small-200`)
MakeResponsive<"" | MaybeTwoValuesShorthandProperty<PaddingKeyword>>
- paddingInlineEnd
Adjust the inline-end padding. This overrides the inline-end value of `paddingInline`. `paddingInlineEnd` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This only accepts 1 value per predicate (e.g. `@container (inline-size > 500px) large-300, small-200`)
MakeResponsive<"" | PaddingKeyword>
- paddingInlineStart
Adjust the inline-start padding. This overrides the inline-start value of `paddingInline`. `paddingInlineStart` also accepts a container query string with the supported PaddingKeyword as a query value e.g. (`@container (inline-size > 500px) large-300, small-300`) This only accepts 1 value per predicate (e.g. `@container (inline-size > 500px) large-300, small-200`)
MakeResponsive<"" | PaddingKeyword>
- queueRender
Queue a run of the render function. You shouldn't need to call this manually - it should be handled by changes to @property values.
() => void
- setAttribute
(name: string, value: string) => void
declare class GridItem extends BoxElement implements GridItemProps {
accessor gridColumn: GridItemProps['gridColumn'];
accessor gridRow: GridItemProps['gridRow'];
constructor();
}
AccessibilityRole
'main' | 'header' | 'footer' | 'section' | 'aside' | 'navigation' | 'ordered-list' | 'list-item' | 'list-item-separator' | 'unordered-list' | 'separator' | 'status' | 'alert' | 'generic' | 'presentation' | 'none'
BackgroundColorKeyword
'transparent' | ColorKeyword
ColorKeyword
'subdued' | 'base' | 'strong'
SizeUnitsOrAuto
SizeUnits | 'auto'
SizeUnits
`${number}px` | `${number}%` | `0`
SizeUnitsOrNone
SizeUnits | 'none'
MakeResponsive
T | `@container${string}`
MaybeAllValuesShorthandProperty
T | `${T} ${T}` | `${T} ${T} ${T}` | `${T} ${T} ${T} ${T}`
PaddingKeyword
SizeKeyword | 'none'
SizeKeyword
'small-500' | 'small-400' | 'small-300' | 'small-200' | 'small-100' | 'small' | 'base' | 'large' | 'large-100' | 'large-200' | 'large-300' | 'large-400' | 'large-500'
MaybeTwoValuesShorthandProperty
T | `${T} ${T}`
BorderShorthand
Represents a shorthand for defining a border. It can be a combination of size, optionally followed by color, optionally followed by style.
BorderSizeKeyword | `${BorderSizeKeyword} ${ColorKeyword}` | `${BorderSizeKeyword} ${ColorKeyword} ${BorderStyleKeyword}`
BorderSizeKeyword
SizeKeyword | 'none'
BorderStyleKeyword
'none' | 'solid' | 'dashed' | 'dotted' | 'auto'
BoxBorderStyles
'auto' | 'none' | 'solid' | 'dashed'
BoxBorderRadii
'small' | 'small-200' | 'small-100' | 'base' | 'large' | 'large-100' | 'large-200' | 'none'
ClickOptions
- sourceEvent
The event you want to influence the synthetic click.
ActivationEventEsque
export interface ClickOptions {
/**
* The event you want to influence the synthetic click.
*/
sourceEvent?: ActivationEventEsque;
}
ActivationEventEsque
- button
number
- ctrlKey
boolean
- metaKey
boolean
- shiftKey
boolean
export interface ActivationEventEsque {
shiftKey: boolean;
metaKey: boolean;
ctrlKey: boolean;
button: number;
}
Code
examples
Code
<s-grid gridTemplateColumns="repeat(2, 1fr)" gap="small" justifyContent="center" > <s-grid-item gridColumn="span 2" border="base" borderStyle="dashed"> Summary of sales </s-grid-item> <s-grid-item gridColumn="span 1" border="base" borderStyle="dashed"> Orders </s-grid-item> <s-grid-item gridColumn="auto" border="base" borderStyle="dashed"> Customers </s-grid-item> </s-grid>
<!DOCTYPE html><html><head><style>html, body {height:100%} body {box-sizing: border-box; margin: 0; padding:0.5rem; display: grid; place-items: center; gap: 0.5rem;}</style><script src="https://cdn.shopify.com/shopifycloud/app-bridge-ui-experimental.js"></script></head><body><s-grid gridTemplateColumns="repeat(2, 1fr)" gap="small" justifyContent="center" > <s-grid-item gridColumn="span 2" border="base" borderStyle="dashed"> Summary of sales </s-grid-item> <s-grid-item gridColumn="span 1" border="base" borderStyle="dashed"> Orders </s-grid-item> <s-grid-item gridColumn="auto" border="base" borderStyle="dashed"> Customers </s-grid-item> </s-grid> </body></html>
Preview
Anchor to useful-forUseful for
- Organizing content into a grid-like layout with columns and rows with consistent alignment and spacing.
- Creating responsive layouts with consistent spacing.
Anchor to considerationsConsiderations
- Grid doesn't include any padding by default. If you need padding around your grid, use
base
to apply the default padding. - Grid will allow children to overflow unless template rows/columns are properly set.
- Grid will always wrap children to a new line. If you need to control the wrapping behavior, use
s-stack
ors-box
.