# ThreadListRuntime
URL: /docs/api-reference/runtimes/thread-list-runtime
Runtime for accessing and managing the list of threads.
`useAui` (Thread List Actions) \[#useaui-thread-list-actions]
Access thread list actions via `useAui`:
```tsx
import { useAui } from "@assistant-ui/react";
const aui = useAui();
// Switch threads
await aui.threads().switchToNewThread();
await aui.threads().switchToThread(threadId);
// Access the main thread runtime
const mainThread = aui.threads().main;
// Access a thread by ID
const thread = aui.threads().getById(threadId);
// Access thread list items
const mainItem = aui.threads().mainItem;
const itemByIndex = aui.threads().getItemByIndex(0);
const itemById = aui.threads().getItemById(threadId);
const archivedItem = aui.threads().getArchivedItemByIndex(0);
// Get current state
const state = aui.threads().getState();
const threadIds = state.threadIds;
const archivedThreadIds = state.archivedThreadIds;
```
`useAuiState` (Thread List State) \[#useauistate-thread-list-state]
Access thread list state reactively:
```tsx
import { useAuiState } from "@assistant-ui/react";
const threads = useAuiState((s) => s.threads.threadIds);
const isLoading = useAuiState((s) => s.threads.isLoading);
```