# Container

- **Section:** Components
- **URL:** https://refast.fastapicloud.dev/docs/components/container
- **Markdown:** https://refast.fastapicloud.dev/docs/components/container.md
- **Source:** https://github.com/idling-mind/refast-docs/blob/main/docs/pages/components/layout/container.py
- **Live examples:** the widgets on this page need a browser; open the URL above to try them.
- **Applies to:** refast 0.12.2

Generic `<div>` wrapper. Use `Container` to group elements and apply Tailwind
utility classes for spacing, borders, backgrounds, and layout.

```python
from refast.components import Container

Container(
    class_name="p-4 border rounded-lg bg-muted/30",
    children=[
        Text("Hello from inside a Container"),
    ],
)
```

Container content

This text lives inside the Container.

class_name="p-4"

## Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `children` | `list \| Component \| None` | `None` | Child components |
| `id` | `str \| None` | `None` | Unique element ID |
| `class_name` | `str` | `""` | Tailwind CSS classes |
| `style` | `dict \| None` | `None` | Inline CSS overrides |

## Notes

`Container` renders a plain `<div>`. It is the most basic building block — use
`Row`, `Column`, `Grid`, or `Flex` when you need flex/grid layout semantics.
Pass any Tailwind classes you need via `class_name`.

## Examples

```python
# Card-like container
Container(
    class_name="p-6 border rounded-xl shadow-sm",
    children=[Heading("My Card", level=3)],
)

# Full-width section with background
Container(
    class_name="w-full bg-muted py-12 px-6",
    children=[...],
)
```

---

Part of the Refast documentation: [all pages](https://refast.fastapicloud.dev/llms.txt), [everything on one page](https://refast.fastapicloud.dev/llms-full.txt), [search](https://refast.fastapicloud.dev/api/search?q=save_prop).
