---
title: Container
description: "`Container` is a component used as a general division element. By default, it renders the `section` element."
links:
- style: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/container/container.style.ts
- source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/container
- storybook: https://yamada-ui.github.io/yamada-ui?path=/story/components-container--basic
---
# Container
`Container` is a component used as a general division element. By default, it renders the `section` element.
```tsx
"Dragon Ball" (DRAGON BALL)
"Dragon Ball" (DRAGON BALL) is a Japanese manga work by Akira Toriyama. It
was serialized in "Weekly Shonen Jump" (Shueisha) from the 51st issue of
1984 to the 25th issue of 1995. It is a long manga that depicts
"adventure", "dream", "battle", "friendship", etc., centered on the
protagonist, Son Goku, and the treasure, Dragon Ball, which can grant any
wish if all seven scattered balls are collected.
```
## Usage
```tsx
import { Container } from "@yamada-ui/react"
```
```tsx
import { Container } from "@/components/ui"
```
```tsx
import { Container } from "@workspaces/ui"
```
```tsx
```
:::tip
Use [Card](https://yamada-ui.com/docs/components/card.md) to group and display related information with a card-like appearance.
:::
### Change Variant
```tsx
{(variant, index) => (
Container
Variant is {variant}
)}
```
### Change Size
```tsx
{(size, index) => (
Container
Size is {size}
)}
```
### Change Color Scheme
```tsx
{(colorScheme, index) => (
Container
ColorScheme is {colorScheme}
)}
```
### Centering Child Elements
```tsx
"Dragon Ball" (DRAGON BALL)
"Dragon Ball" (DRAGON BALL) is a Japanese manga work by Akira Toriyama. It
was serialized in "Weekly Shonen Jump" (Shueisha) from the 51st issue of
1984 to the 25th issue of 1995. It is a long manga that depicts
"adventure", "dream", "battle", "friendship", etc., centered on the
protagonist Goku (Son Goku), and the treasure "Dragon Ball" that can grant
any wish if all seven balls scattered around the world are collected.
```
## Props
### Container.Root
| Prop | Default | Type | Description |
| ------------- | --------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| `as` | - | `As` | The HTML element to render. |
| `asChild` | - | `boolean` | Merges its props onto its immediate child. |
| `css` | - | `CSSObject \| CSSObject[]` | The CSS object. |
| `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. |
| `size` | `"lg"` | `"lg" \| "md" \| "sm" \| "xl"` | The size of the component. |
| `variant` | `"panel"` | `"elevated" \| "outline" \| "panel" \| "solid" \| "subtle" \| "surface" ...` | The variant of the component. |
### Container.Body
| Prop | Default | Type | Description |
| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| `as` | - | `As` | The HTML element to render. |
| `asChild` | - | `boolean` | Merges its props onto its immediate child. |
| `css` | - | `CSSObject \| CSSObject[]` | The CSS object. |
| `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. |
### Container.Footer
| Prop | Default | Type | Description |
| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| `as` | - | `As` | The HTML element to render. |
| `asChild` | - | `boolean` | Merges its props onto its immediate child. |
| `css` | - | `CSSObject \| CSSObject[]` | The CSS object. |
| `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. |
### Container.Header
| Prop | Default | Type | Description |
| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| `as` | - | `As` | The HTML element to render. |
| `asChild` | - | `boolean` | Merges its props onto its immediate child. |
| `css` | - | `CSSObject \| CSSObject[]` | The CSS object. |
| `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. |
## Similar Components
- [Bleed](https://yamada-ui.com/docs/components/bleed.md): `Bleed` is a component used to extend elements beyond the boundaries of a container.
- [Box](https://yamada-ui.com/docs/components/box.md): `Box` is the most abstract component on which all other components are built. By default, it renders a `div` element.
- [Center](https://yamada-ui.com/docs/components/center.md): `Center` is a component that aligns the child elements in the center within the component.
- [Flex](https://yamada-ui.com/docs/components/flex.md): `Flex` is a component that sets `flex` to `Box`. Also, convenient style shorthand is available.
- [Float](https://yamada-ui.com/docs/components/float.md): `Float` is a component used to fix elements to the edges of a container.
- [Grid](https://yamada-ui.com/docs/components/grid.md): `Grid` is a component for managing grid layouts. It also comes with handy style shorthand.
- [Group](https://yamada-ui.com/docs/components/group.md): `Group` is a component that groups and attaches multiple elements together.
- [HStack](https://yamada-ui.com/docs/components/h-stack.md): `HStack` is used to stack child elements horizontally.