# AtlasStatus

> The values of \`status\` on lists, tables, trees and pages: Ready, Loading, Empty, NoResults and Error.

`AtlasStatus` is a singleton that only holds an enum: the values of the `status` property of [AtlasListView](https://atlasos.eterneon.net/framework/atlas-ui/atlas-list-view.md), [DataTable](https://atlasos.eterneon.net/framework/atlas-ui/data-table.md), [AtlasTreeView](https://atlasos.eterneon.net/framework/atlas-ui/atlas-tree-view.md) and [AtlasPage](https://atlasos.eterneon.net/framework/atlas-ui/atlas-page.md). It cannot be created and has no properties. A view shows what its `status` says in place of its rows, so an app sets one value instead of building a spinner, an empty state and an error state by hand.

## Example

```qml
AtlasListView {
    model: files
    status: files.loading ? AtlasStatus.Loading
          : files.failed ? AtlasStatus.Error
          : files.count === 0 ? (query.length > 0 ? AtlasStatus.NoResults : AtlasStatus.Empty)
          : AtlasStatus.Ready
    statusText: files.failed ? qsTr("The folder could not be read.") : ""
    statusAction: AtlasAction {
        text: files.failed ? qsTr("Retry") : qsTr("Clear search")
        onTriggered: files.failed ? files.reload() : query = ""
    }
}
```

## Enums

### Status

| Value | Number | The view shows |
|---|---|---|
| `Ready` | 0 | Its rows (the default). A list or table with no rows still shows its `placeholderText`. |
| `Loading` | 1 | An [AtlasSpinner](https://atlasos.eterneon.net/framework/atlas-ui/atlas-spinner.md), only after 300 ms: a load that ends sooner shows no flash. Nothing is announced. `statusTitle` and `statusText` show under the spinner when set. |
| `Empty` | 2 | An [AtlasEmptyState](https://atlasos.eterneon.net/framework/atlas-ui/atlas-empty-state.md) with the Inbox symbol and the heading "Nothing here". |
| `NoResults` | 3 | The same with the SearchOff symbol and "No results". |
| `Error` | 4 | The same with the Error symbol and "Something went wrong". It is announced to screen readers once, when the status becomes Error. |

The heading, the explanation, the symbol and one action button come from the view's `statusTitle`, `statusText`, `statusSymbol` and `statusAction`. The status replaces the rows and keeps the header: a [DataTable](https://atlasos.eterneon.net/framework/atlas-ui/data-table.md)'s column header and an [AtlasPage](https://atlasos.eterneon.net/framework/atlas-ui/atlas-page.md)'s title stay.
