Container

A width limit for page content. The container sits in the middle of the page, with padding at the sides, and its content keeps its normal alignment.

This text sits inside a container. The container sets how wide the text can get and adds space on its left and right sides.

Usage

Default max width: 8xl, which is 90rem (1440px).

Code
import { Container } from '@leverui/components';

export function ContainerUsage() {
  return (
    <Container>
      <div />
    </Container>
  );
}

Examples

Sizes

Use a CSS class to set a different maximum width for each container.

This text sits inside a container. The container sets how wide the text can get and adds space on its left and right sides.
This text sits inside a container. The container sets how wide the text can get and adds space on its left and right sides.
This text sits inside a container. The container sets how wide the text can get and adds space on its left and right sides.
This text sits inside a container. The container sets how wide the text can get and adds space on its left and right sides.

Fluid

Set fluid to stretch the container across its parent.

This text sits inside a container. The container sets how wide the text can get and adds space on its left and right sides.

Props

PropDefaultTypeDescription
asdivNative HTML tagHTML tag to render.
asChild—Solid render callbackRender your own element as the container.
centerContentfalseResponsive booleanStack the children and center them.
fluidfalseResponsive booleanFill the width of the parent.
unstyledfalseBooleanTurn off the default layout styles.

Change the width or side padding with class or style. Variables include --leverui-container-max-width, --leverui-container-fluid-max-width, and --leverui-container-padding.

ContainerPropsProvider sets default props for the containers inside it. A prop on a Container wins.