
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@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 | union Possible values: 'grid' , 'inline-grid' | 'grid' | ||
gridTemplateColumns | string | |||
gridTemplateRows | string | |||
gridTemplateAreas | string | |||
gridTemplate | string | |||
gridColumnGap | string | |||
gridRowGap | string | |||
gridGap | string | |||
justifyItems | union Possible values: 'start' , 'end' , 'center' , 'stretch' | |||
alignItems | union Possible values: 'start' , 'end' , 'center' , 'stretch' | |||
placeItems | union Possible values: 'start' , 'end' , 'center' , 'stretch' | |||
justifyContent | union Possible values: , 'start', 'end', 'center', 'stretch', 'space-around', 'space-between', 'space-evenly' | |||
alignContent | union Possible values: , 'start', 'end', 'center', 'stretch', 'space-around', 'space-between', 'space-evenly' | |||
placeContent | union Possible 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.