Ballmac UI home

Knowledge Sources

New

The places an assistant reads from: each source's kind, document count and freshness, a switch for whether answers may use it, live sync progress, a failed sync with the reason and Retry, and Remove that asks first.

v1.0.0Updated Oct 25, 2026Ships with a test
What changed

Knowledge sources

1,780 documents from 4 sources are used in answers1 needs attention

  • Product docs

    Workspace: Acme · 1,284 documents

    Up to date

    Synced 12 minutes ago

  • Support macros

    Shared drive / Support / Macros · 342 documents

    Syncing, 62%

  • ui.acme.com

    Crawled weekly, 3 levels deep · 96 documents

    Up to date

    Synced Yesterday

  • acme/platform

    README and /docs on main · 58 documents

    Sync failed

    Synced 3 days ago

  • #help-questions

    Last 90 days · 2,210 documents

    Paused

    Synced Oct 2

Installation

$ pnpm dlx shadcn@latest add @ballmac/knowledge-sources

Usage

import { KnowledgeSources } from "@/components/ballmac/knowledge-sources"

The full example is in the Code tab above.

Examples

No sources yet

Knowledge sources

0 documents from 0 sources are used in answers

  • No sources yet. Add one and the assistant can answer from it.

API reference

PropTypeDefault
sources*

The starting sources. The component keeps its own copy and reports every change.

KnowledgeSource[]—
titlestring—
onAdd

Adds the "Add a source" button.

() => void—
onSync

Called to sync a source now. Reject and it shows the error with Retry.

(id: string) => void | Promise<void>—
onToggle

Called when "Use in answers" changes. Reject and it goes back with the reason.

(id: string, included: boolean) => void | Promise<void>—
onRemove

Adds Remove, which asks first. Reject and the source stays.

(id: string) => void | Promise<void>—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
SwitchEach source has a role=switch named 'Use <name> in answers'
StatusSaid in words with an icon, never by color alone; progress is also text
ActionsSync and Retry buttons name the source; Remove opens a confirmation group with focus on Keep it
ResultsAnnounced politely; failures are alerts

Use with AI

sources is [{ id, name, kind 'drive'|'notion'|'github'|'web'|'slack'|'files'|'database'|string, detail?, status 'synced'|'syncing'|'error'|'paused', docs, lastSync?, error?, progress? 0-1, included }]. The component keeps its own copy and calls onSync(id), onToggle(id, included), onRemove(id) and onAdd(). Handlers may be async; a rejected sync shows the error with Retry, a rejected toggle or remove puts things back and says why. The header sums only the documents in use. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Knowledge Sources (@ballmac/knowledge-sources) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • The settings page where a team connects what an assistant can read
  • Showing the health of a search or RAG index

Not for

  • Browsing the documents themselves; use a file table
  • Choosing a model; use model-picker

Registry JSON: https://ui.ballmac.com/r/knowledge-sources.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.