# ThreadPrimitive
URL: /docs/api-reference/primitives/thread
Primitives for the message list, viewport, and welcome screen.
A conversation between a user and an assistant.
Anatomy \[#anatomy]
```tsx
import { ThreadPrimitive } from "@assistant-ui/react";
const Thread = () => (
s.thread.isEmpty}>...{...}
);
```
API Reference \[#api-reference]
Root \[#root]
Contains all parts of the thread.
This primitive renders a `
` element unless `asChild` is set.
Viewport \[#viewport]
The scrollable area containing all messages. Anchors scroll to the bottom as new messages are added.
This primitive renders a `
` element unless `asChild` is set.
ViewportFooter \[#viewportfooter]
A footer container placed inside `ThreadPrimitive.Viewport` that measures its own height (including top margin) and reports it to the viewport context. The viewport uses this measurement in scroll calculations — for example, as the minimum height for `ViewportSlack` — so that the scroll-to-bottom behaviour accounts for any sticky footer overlapping the message list.
Multiple `ViewportFooter` components may be used; their heights are summed.
This primitive renders a `
` element unless `asChild` is set.
```tsx
{...}
```
Messages \[#messages]
Renders all messages. This primitive renders a separate component for each message.
MessageByIndex \[#messagebyindex]
Renders a single message at the specified index in the current thread.
```tsx
{({ message }) => message.role === "user" ? : }
```
Empty \[#empty]
**Deprecated.** Use ` s.thread.isEmpty}>` instead.
Renders children only when there are no messages.
ScrollToBottom \[#scrolltobottom]
A button to scroll the viewport to the bottom. Disabled when the viewport is already at bottom.
This primitive renders a `