Hooks
Focused helpers for message parts, quotes, timing, and viewport behavior.
Utility hooks expose commonly needed slices of assistant-ui behavior without requiring a full primitive.
Message Helpers
useMessageQuotereads the quote state for the current message.useMessageTimingreads timing metadata for the current message.
Message Part Helpers
useMessagePartTextuseMessagePartReasoninguseMessagePartSourceuseMessagePartFileuseMessagePartImageuseMessagePartData
These hooks are intended for custom message part renderers. They read the nearest message part context established by MessagePrimitive.Parts, MessagePartPrimitive, or the lower-level providers.
Viewport Helpers
useThreadViewportreads and controls the thread viewport.useThreadViewportAutoScrollwires auto-scroll behavior for custom viewport compositions.useScrollLockhelps reasoning and grouped-part UIs preserve scroll behavior while content changes.
For primitive-specific prop APIs, see Primitives.