---
title: Container
description: "`Container`は、汎用的な区分要素として使用するコンポーネントです。デフォルトでは、`section`要素をレンダリングします。"
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
---
```tsx
『ドラゴンボール』(DRAGON BALL)
『ドラゴンボール』(DRAGON
BALL)は、鳥山明による日本の漫画作品。『週刊少年ジャンプ』(集英社)にて1984年51号から1995年25号まで連載された。世界中に散らばった七つの球をすべて集めると、どんな願いも一つだけ叶えられるという秘宝・ドラゴンボールと、主人公・孫悟空(そん・ごくう)を中心に展開する、「冒険」「夢」「バトル」「友情」などを描いた長編漫画。
```
## 使い方
```tsx
import { Container } from "@yamada-ui/react"
```
```tsx
import { Container } from "@/components/ui"
```
```tsx
import { Container } from "@workspaces/ui"
```
```tsx
```
### バリアントを変更する
```tsx
{(variant, index) => (
Container
Variant is {variant}
)}
```
### サイズを変更する
```tsx
{(size, index) => (
Container
Size is {size}
)}
```
### カラースキームを変更する
```tsx
{(colorScheme, index) => (
Container
ColorScheme is {colorScheme}
)}
```
### 子要素を中央寄せにする
```tsx
『ドラゴンボール』(DRAGON BALL)
『ドラゴンボール』(DRAGON
BALL)は、鳥山明による日本の漫画作品。『週刊少年ジャンプ』(集英社)にて1984年51号から1995年25号まで連載された。世界中に散らばった七つの球をすべて集めると、どんな願いも一つだけ叶えられるという秘宝・ドラゴンボールと、主人公・孫悟空(そん・ごくう)を中心に展開する、「冒険」「夢」「バトル」「友情」などを描いた長編漫画。
```
## 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. |
| `centerContent` | `false` | `boolean` | If `true`, container will center its children regardless of their width. |
### 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. |