List#

The List widget is used when you need to display a list of items, works like the Select widget.

from aiogram_dialog import Dialog, Window
from aiogram_dialog.widgets.text import List, Format


async def getter_example(**kwargs):
    return {
        "user_info": (
            ("name", "Tishka17"),
            ("username", "@Tishka17"),
        )
    }


dialog = Dialog(
    Window(
        List(
            Format("+ {item[0]} - {item[1]}"),
            items="user_info",
        ),
        getter=getter_example,
        ...
    ),
)

Result:

../../../_images/list.png

Additionally, you can provide page_size and id so the List will allow you to paginate its items. You can combine it with Pager widgets to switch pages.