
Security News
Scaling Socket from Zero to 10,000+ Organizations
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.
@commercetools-uikit/grid
Advanced tools
The Grid component can be used to implement layouts using CSS-Grid.
The Grid component can be used to implement layouts using CSS-Grid.
CSS Grid Layout is the most powerful layout system available in CSS. It is a 2-dimensional system, meaning it can handle both columns and rows, unlike flexbox which is largely a 1-dimensional system. You work with Grid Layout by applying CSS rules both to a parent element (which becomes the Grid Container) and to that elements children (which become Grid Items).
The component accepts all the supported properties of CSS Grid, both for the parent container and the children elements (<Grid.Item>).
yarn add @commercetools-uikit/grid
npm --save install @commercetools-uikit/grid
Additionally install the peer dependencies (if not present)
yarn add react
npm --save install react
import Grid from '@commercetools-uikit/grid';
/**
* We also recommend having a look at the [Grid story examples](https://uikit.commercetools.com/?path=/story/examples-components-grid--with-fixed-columns)
* to see more detailed examples of common use cases of the CSS Grid layout.
**/
const Example = () => (
<Grid
gridGap="16px"
gridAutoColumns="1fr"
gridTemplateColumns="repeat(3, 1fr)"
>
<Grid.Item>{'1'}</Grid.Item>
<Grid.Item>{'2'}</Grid.Item>
<Grid.Item>{'3'}</Grid.Item>
<Grid.Item>{'4'}</Grid.Item>
<Grid.Item>{'5'}</Grid.Item>
</Grid>
);
export default Example;
| Props | Type | Required | Default | Description |
|---|---|---|---|---|
children | ReactNode | ✅ | ||
display | unionPossible values: 'grid' , 'inline-grid' | 'grid' | ||
gridTemplateColumns | string | |||
gridTemplateRows | string | |||
gridTemplateAreas | string | |||
gridTemplate | string | |||
gridColumnGap | string | |||
gridRowGap | string | |||
gridGap | string | |||
justifyItems | unionPossible values: 'start' , 'end' , 'center' , 'stretch' | |||
alignItems | unionPossible values: 'start' , 'end' , 'center' , 'stretch' | |||
placeItems | unionPossible values: 'start' , 'end' , 'center' , 'stretch' | |||
justifyContent | unionPossible values: , 'start', 'end', 'center', 'stretch', 'space-around', 'space-between', 'space-evenly' | |||
alignContent | unionPossible values: , 'start', 'end', 'center', 'stretch', 'space-around', 'space-between', 'space-evenly' | |||
placeContent | unionPossible values: , 'start', 'end', 'center', 'stretch', 'space-around', 'space-between', 'space-evenly' | |||
gridAutoColumns | string | |||
gridAutoRows | string | |||
gridAutoFlow | string | |||
grid | string |
The component accepts all supported CSS Grid properties, as listed here, in camelCase format
FAQs
The Grid component can be used to implement layouts using CSS-Grid.
We found that @commercetools-uikit/grid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.

Research
Socket Threat Research maps a rare inside look at OtterCookie’s npm-Vercel-GitHub chain, adding 197 malicious packages and evidence of North Korean operators.

Research
Socket researchers identified a malicious Chrome extension that manipulates Raydium swaps to inject an undisclosed SOL transfer, quietly routing fees to an attacker wallet.