AI Assistant

Container

The Container component provides features such as fluid width, text alignment, and padding adjustments based on screen size. Use it to create responsive layouts as a wrapper for other components and content. By default the container is centered with a max-width of 1280px (1440px from the xxxl breakpoint) and 20px padding (40px from the lg breakpoint).

import React from "react";
import { Container } from "cherry-styled-components";

export default function Page() {
  return <Container $textAlign="center">Your content goes here!</Container>;
}

Properties

childrenReact.ReactNode

Container content.

classNamestring

Class name applied to the container element.

$fluidboolean

Makes the container full-width without max-width constraints.

$textAlign"right" | "left" | "center"

Text alignment within the container.

$paddingnumber | "none"

Base padding value in pixels. Replaces both the 20px default and the 40px lg-breakpoint default. Pass a number here: "none" is only handled by the breakpoint-specific props and produces invalid CSS on $padding, so use $xsPadding="none" to remove padding instead.

$xsPaddingnumber | "none"

Padding at xs breakpoint.

$smPaddingnumber | "none"

Padding at sm breakpoint.

$mdPaddingnumber | "none"

Padding at md breakpoint.

$lgPaddingnumber | "none"

Padding at lg breakpoint.

$xlPaddingnumber | "none"

Padding at xl breakpoint.

$xxlPaddingnumber | "none"

Padding at xxl breakpoint.

$xxxlPaddingnumber | "none"

Padding at xxxl breakpoint.

The Container also accepts all standard HTML div attributes and forwards its ref to the underlying div element.