Grid and Grid.Section
Use these components to control the size of cards and display them in a responsive grid.
#Example
Use the Grid.Section component to control the size of cards. Wrap it around one or more cards and use its size
property to set a desired size. The Grid.Section component also adds space between cards and makes them responsive, by automatically adjusting their width on smaller viewports.
The Grid component lays out cards in a grid. To use it, all you need to do is wrap it around Grid.Section components. In the example below, you can see both components doing their thing.
Full (default)
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit. Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur efficitur justo non egestas.
Half
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit. Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur efficitur justo non egestas.
Fourth A
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit. Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur efficitur justo non egestas.
Fourth B
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit. Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur efficitur justo non egestas.
Third
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit. Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur efficitur justo non egestas.
Two thirds
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit. Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur efficitur justo non egestas.
<Grid>
<Grid.Section>
<Card>
<Card.Header>Full (default)</Card.Header>
<Content>
<TextContainer article>
<Paragraph>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit.
Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur
efficitur justo non egestas.
</Paragraph>
</TextContainer>
</Content>
</Card>
</Grid.Section>
<Grid.Section size="half">
<Card>
<Card.Header>Half</Card.Header>
<Content>
<TextContainer article>
<Paragraph>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit.
Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur
efficitur justo non egestas.
</Paragraph>
</TextContainer>
</Content>
</Card>
</Grid.Section>
<Grid.Section size="fourth">
<Card>
<Card.Header>Fourth A</Card.Header>
<Content>
<TextContainer article>
<Paragraph>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit.
Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur
efficitur justo non egestas.
</Paragraph>
</TextContainer>
</Content>
</Card>
</Grid.Section>
<Grid.Section size="fourth">
<Card>
<Card.Header>Fourth B</Card.Header>
<Content>
<TextContainer article>
<Paragraph>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit.
Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur
efficitur justo non egestas.
</Paragraph>
</TextContainer>
</Content>
</Card>
</Grid.Section>
<Grid.Section size="third">
<Card>
<Card.Header>Third</Card.Header>
<Content>
<TextContainer article>
<Paragraph>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit.
Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur
efficitur justo non egestas.
</Paragraph>
</TextContainer>
</Content>
</Card>
</Grid.Section>
<Grid.Section size="twothirds">
<Card>
<Card.Header>Two thirds</Card.Header>
<Content>
<TextContainer article>
<Paragraph>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit.
Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur
efficitur justo non egestas.
</Paragraph>
</TextContainer>
</Content>
</Card>
</Grid.Section>
</Grid>
#Properties
#Grid.Section
Card
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit. Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur efficitur justo non egestas.
Property | Description | Defined | Value |
---|---|---|---|
childrenRequired | | element | element[] Children should likely be `Card`'s but can be anything | ||
sizeOptional | "fourth" | "full" | "half" | "third" | "threefourths" | "twothirds" | "¼" | "½" | "¾" | "⅓" | "⅔" Defaults to "full", controls the size of the section | ||
data-observe-keyOptional | string Unique string, used by external script e.g. for event tracking | ||
classNameOptional | string Custom className that's applied to the outermost element (only intended for special cases) | ||
styleOptional | object Style object to apply custom inline styles (only intended for special cases) |
#Grid
Card
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit. Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur efficitur justo non egestas.
Card
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit. Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur efficitur justo non egestas.
Card
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur at odio elit. Donec laoreet massa justo, at sagittis nulla volutpat vitae. Nullam efficitur efficitur justo non egestas.
Property | Description | Defined | Value |
---|---|---|---|
childrenOptional | element Children should be `Grid.Section` components | ||
data-observe-keyOptional | string Unique string, used by external script e.g. for event tracking | ||
classNameOptional | string Custom className that's applied to the outermost element (only intended for special cases) | ||
styleOptional | object Style object to apply custom inline styles (only intended for special cases) |
#Guidelines
#Best practices
#Do not use when
#Accessibility
Explore detailed guidelines for this component: Accessibility Specifications