Connect first source (Pro)
ProIncluded in $99The onboarding step that connects one source and answers from it before reading has finished.
On this page
Installation
Needs chatcn Pro
This command works with a Pro license, along with every Pro component.
Or start free: sign up and get three Pro components on us, with a new one every month.
Usage
import { ConnectFirstSource } from "@/components/ui/chatcn/pro/connect-first-source"
<ConnectFirstSource
providers={[{ id: "notion", name: "Notion", description: "Docs and wikis", icon: <NotionMark /> }, …]}
status={status} // "pick" | "connecting" | "reading" | "answering" | "ready" | "error"
source={source}
progress={{ read: 86, total: 412, current: "Hiring plan 2027" }}
suggestions={firstQuestions}
question={question}
answer={answer}
citations={[{ title: "Q4 roadmap", meta: "Edited 2 days ago", href: "…" }]}
onPick={startOAuth}
onAsk={ask}
onContinue={finishOnboarding}
/>Your app drives status and the step shows each stage. Pick lists the sources with what each one reads; connecting waits on the provider's sign in window and can be cancelled; once connected, a strip at the top keeps the reading count, a bar and the title being read in view for the rest of the step. First questions arrive while it reads (write them from the first documents read, so they are about this workspace), and the reader can ask their own. The first answer streams in with the documents it came from. Continue unlocks once there is an answer, and reading carries on after the step closes. chatcn ships no third party logos: pass your own marks, or the first letter stands in.
Examples
States
Props
| Prop | Type | Notes |
|---|---|---|
providers | FirstSourceProvider[] | { id, name, description?, icon? } |
status | ConnectFirstSourceStatus | The stage, driven by your app |
source | string | The provider picked |
progress | { read, total?, current? } | Without total the bar is left out |
suggestions | string[] | First questions; a placeholder shows until they arrive |
question, answer, citations | The first exchange; answer grows as it streams | |
error | ReactNode | Why connecting failed, and what to do |
onPick, onUpload, onCancel, onAsk, onRetry, onContinue, onSkip | ||
labels | Partial<ConnectFirstSourceLabels> | Every string, for translation |
Accessibility
- Waiting and the question placeholder are status regions; a failed connect is an alert.
- Reading progress is a progressbar named by the source; the ticking title is hidden from screen readers.
- The finished answer is announced once, not token by token.
Motion
Each stage rises in over 240 ms. The title being read changes in place, the bar moves with transform only, and first questions arrive 50 ms apart. No movement on first paint or under reduced motion.