TranscriptSearch

A find bar for a conversation: query input, a 3/12 counter, previous and next buttons and close. Enter goes to the next match, Shift+Enter to the previous one, Escape closes. The counter appears once the query is not empty and shows 0/0 when nothing matches; the arrows are disabled without matches. The component is controlled and does not search by itself. In most apps you do not render it: set withSearch on AgentChat or MessageList and Mod+F opens this bar, highlights matches in the transcript and scrolls to the active one. Render it yourself for a custom transcript, using the exported helpers: findTextMatches (case-insensitive matches in a string), findDomMatches (DOM ranges inside an element, skipping [data-search-ignore]) and stepMatchIndex (wrap-around navigation). The bar is a compact Paper that fits a 360px widget.

Getting Started
$pnpm add @sinups/ai-kit @mantine/core @mantine/hooks @tabler/icons-react
Examples
Custom transcript
API reference
Prop
Type
Required
value
string
Yes
Search query
onChange
(value: string) => void
Yes
Called with the new query
activeIndex
number
Yes
Index of the active match, `-1` when there is none
total
number
Yes
Number of matches
onNext
() => void
Yes
Moves to the next match, also on Enter
onPrevious
() => void
Yes
Moves to the previous match, also on Shift+Enter
onClose
() => void
Yes
Closes the search, also on Escape
inputRef
React.Ref<HTMLInputElement>
No
Ref of the input, for focusing it from a shortcut
labels
Partial<TranscriptSearchLabels>
No
Overrides of the default English labels
className
string
No
Class name added to the root element
style
React.CSSProperties
No
Inline styles added to the root element