Empty and Loading States

Swap data, fetching flags, loader props, and empty-state content from one table configuration.

Empty and Loading States

Swap data, fetching flags, loader props, and empty-state content from one table configuration.

Source: usage.py::build_states_code(**STATES_DEMO_DEFAULTS).

table = (
    dmdt.DataTable(
        id="states-table",
        data=EMPLOYEES[:4],
        columns=STATES_DEMO_COLUMNS,
        fetching=True,
        loaderType="oval",
        loaderColor="blue",
        loaderSize="md",
        loaderBackgroundBlur=2,
        emptyState=dmc.Stack(
            [
                DashIconify(icon="tabler:database-off", width=28),
                dmc.Text("No employees found", c="dimmed", ta="center"),
            ],
            align="center",
            gap=6,
        ),
        paginationMode="none",
    )
    .update_layout(
        radius="lg",
        withTableBorder=True,
        minHeight=220,
    )
)