Skip to content
Sign upPro
BillingConnect first sourceMenu

Connect first source (Pro)

ProIncluded in $99

The onboarding step that connects one source and answers from it before reading has finished.

ProPick a source: it signs in, starts reading, and answers the first question before reading has finished.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/connect-first-source

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

tsx
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

ProWaiting on sign in, reading with first questions on the way, the first answer, and a failed connect.

Props

PropTypeNotes
providersFirstSourceProvider[]{ id, name, description?, icon? }
statusConnectFirstSourceStatusThe stage, driven by your app
sourcestringThe provider picked
progress{ read, total?, current? }Without total the bar is left out
suggestionsstring[]First questions; a placeholder shows until they arrive
question, answer, citationsThe first exchange; answer grows as it streams
errorReactNodeWhy connecting failed, and what to do
onPick, onUpload, onCancel, onAsk, onRetry, onContinue, onSkip
labelsPartial<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.