# Container

> Cherry Container component - fluid width, text alignment, and responsive padding.

Source: https://cherry.al/code/container

> For the complete documentation index, see [llms.txt](https://cherry.al/llms.txt).

# 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).

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

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

## Properties

<Field value="children" type="React.ReactNode">
  Container content.
</Field>

<Field value="className" type="string">
  Class name applied to the container element.
</Field>

<Field value="$fluid" type="boolean">
  Makes the container full-width without max-width constraints.
</Field>

<Field value="$textAlign" type='"right" | "left" | "center"'>
  Text alignment within the container.
</Field>

<Field value="$padding" type='number | "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.
</Field>

<Field value="$xsPadding" type='number | "none"'>
  Padding at `xs` breakpoint.
</Field>

<Field value="$smPadding" type='number | "none"'>
  Padding at `sm` breakpoint.
</Field>

<Field value="$mdPadding" type='number | "none"'>
  Padding at `md` breakpoint.
</Field>

<Field value="$lgPadding" type='number | "none"'>
  Padding at `lg` breakpoint.
</Field>

<Field value="$xlPadding" type='number | "none"'>
  Padding at `xl` breakpoint.
</Field>

<Field value="$xxlPadding" type='number | "none"'>
  Padding at `xxl` breakpoint.
</Field>

<Field value="$xxxlPadding" type='number | "none"'>
  Padding at `xxxl` breakpoint.
</Field>

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

<Button href="https://github.com/cherry-design-system/styled-components/blob/main/src/lib/container.tsx" icon="code" iconPosition="left">
  View Source
</Button>
