Container

Component used to structure the content.

The <Container> component is a CSS grid layout component in which you can wrap child components. This component should be used if you want to structure content or form components. It is also useful when you want to use a <Breakout>.

<Container> width is based on used font and is optimized for readability. You can use header or content as content type and set the size prop to small, medium or large.

It is also possible to set the alignment for the <Container> itself and for its children.

Import

To import the component you just have to use this code below.

import { Container } from '@marigold/components';

Props

PropertyTypeDefaultDescription
contentType"header" | "content""content"The content type of the container.
size"small" | "medium" | "large""medium"The size of the container.
align"left" | "center" | "right""left"Set alignment the content inside the container.
alignItems"left" | "center" | "right" | "none""none"Set alignment of the items inside the container.

Examples

Container sizes

In this example the size prop is set to small. You can also choose medium or large size. It sets the width of the content of the container.

Star Wars - The Empire Strikes Back

It is a dark time for the Rebellion. Although the Death Star has been destroyed, Imperial troops have driven the Rebel forces from their hidden base and pursued them across the galaxy.

Text Container

In some cases, the width of the content can be smaller than the container's width. You can use the align prop to align the container left, center or right. The alignItems props allows you to align the children left, center or right.

Star Wars - The Empire Strikes Back

It is a dark time for the Rebellion. Although the Death Star has been destroyed, Imperial troops have driven the Rebel forces from their hidden base and pursued them across the galaxy. Evading the dreaded Imperial Starfleet, a group of freedom fighters led by Luke Skywalker has established a new secret base on the remote ice world of Hoth. The evil lord Darth Vader, obsessed with finding young Skywalker, has dispatched thousands of remote probes into the far reaches of space....

  • Luke
  • Leia
  • Han Solo
  • Chewbacca
  • R2D2
  • C3PO
  • Darth Vader