# List

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

Ordered or unordered list rendering. Children can be plain strings or
any component that renders to a list item.

```python
from refast.components import List

# Bullet list
List(children=["Apples", "Bananas", "Cherries"])

# Numbered list
List(ordered=True, children=["First step", "Second step", "Third step"])
```

First item in the list

Second item with more detail

Third item — nested content supported

Fourth item

```python
List(
    ordered=False,
    children=[
        "First item in the list",
        "Second item with more detail",
        "Third item — nested content supported",
        "Fourth item",
    ],
)
```

## List Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `children` | `list` | `[]` | List items — strings or components. |
| `ordered` | `bool` | `False` | If `True`, renders a numbered `<ol>`; otherwise a bulleted `<ul>`. |
| `class_name` | `str` | `""` | Extra Tailwind classes. |

## Unordered list

```python
List(children=[
    "Item one",
    "Item two",
    "Item three",
])
```

## Ordered list

```python
List(
    ordered=True,
    children=[
        "Install Refast: pip install refast",
        "Create your app: ui = RefastApp()",
        "Define a page: @ui.page('/')",
        "Run it: uvicorn app:app --reload",
    ],
)
```

## Rich list items with Row/Badge

Use `Column` + individual `Row` items for rich list-style layouts without
the semantic list markup:

```python
Column(
    gap=2,
    children=[
        Row(align="center", gap=2, children=[
            Badge(children=["NEW"], variant="success"),
            Text("Feature announcement", class_name="font-medium"),
        ]),
        Row(align="center", gap=2, children=[
            Badge(children=["FIX"]),
            Text("Bug fix for table sorting"),
        ]),
    ],
)
```

---

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