Xzero UI
Pro library

Connector setupPro

A "Connect your tools" card for an AI assistant. Each app connects inline: it redirects, authorizes and runs a first sync with a progress hairline, then lists the scopes it was granted and offers Disconnect with an inline confirm.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/connector-setup
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/connector-setup

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { ConnectorSetup } from "@/components/xzero/connector-setup/connector-setup";

export function Integrations({ connectedIds }: { connectedIds: string[] }) {
  return (
    <ConnectorSetup
      defaultConnected={connectedIds}
      connect={async (app, { signal, report }) => {
        const popup = await openOAuthPopup(app.id, { signal });
        report({ phase: "authorizing" });
        const grant = await popup.result;
        report({ phase: "syncing", synced: 0 });
        const { total } = await startFirstSync(app.id, grant, { signal, onProgress: synced => report({ synced }) });
        return { account: grant.workspace, scopes: grant.scopes, synced: total };
      }}
      disconnect={(app, { signal }) => revokeGrant(app.id, { signal })}
      onConnectedChange={ids => saveConnectedApps(ids)}
    />
  );
}

API reference

ConnectorSetup

A "Connect your tools" card for an AI assistant. Each app connects inline through redirect, authorize and first sync with a progress line, then lists the scopes it granted with a Disconnect option. With no props it renders eight sample apps and plays a short scripted run.

PropTypeDefaultDescription
connectorsConnector[]connectorSamplesApps to list: { id, name, description, mark, host?, account?, scopes?, sync?: { count, noun }, keywords? }. mark is a built-in id (slack, github, notion, google-drive, linear, jira, salesforce, hubspot) or your own 20px node.
connectedstring[]–Controlled list of connected ids.
defaultConnectedstring[]["github", "google-drive"] for the samples, [] otherwiseIds connected on mount when uncontrolled.
onConnectedChange(ids: string[]) => void–Called with the new list after a connect or disconnect finishes.
connect(connector, { signal, report }) => Promise<ConnectResult | void>–Runs your real OAuth flow. Call report({ phase: "authorizing" }) and report({ phase: "syncing", synced }) as it advances; throw an Error to show its message with Retry; return { account?, scopes?, synced? } to finish. signal aborts on Cancel or unmount. Simulated when omitted.
disconnect(connector, { signal }) => Promise<void>–Revokes access after the inline confirmation. Simulated when omitted.
onConnect(connector: Connector, result: ConnectResult) => void–Called once a connection completes, with the account, scopes and sync count.
onDisconnect(connector: Connector) => void–Called once access is revoked.
assistantNamestring"Claude"Used in the description, the scopes heading and the footer.
titleReactNode"Connect your tools"Card heading.
descriptionReactNode"Let Claude search and act in the apps your team uses."Line under the heading.
searchablebooleantrueShows the search field. It matches name, description, account and keywords.
searchPlaceholderstring"Search apps"Placeholder for the search field.
autoPlaybooleantrue for the samples without connectPlays a scripted run once the card is on screen: connect Slack, then a Salesforce attempt that needs admin approval and its retry. Stops at the first pointer or key press.
footerReactNode–Footer line under the list. Defaults to a short privacy note; pass null to hide it.
classNamestring–Class on the root card.

ConnectorMark

The built-in app marks at any size, for use elsewhere in your settings UI.

PropTypeDefaultDescription
mark (required)ConnectorMarkId | ReactNode–A built-in id or your own node.
sizenumber20Rendered size in px.

Keyboard interactions

KeysAction
TabMoves through search, each row's Connect, Cancel, Retry or Connected button, and the open details.
Enter / SpaceConnects, cancels, retries, or opens and closes a connected app's access details.
EscapeClears the search field, or backs out of the disconnect confirmation.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in ai

Guidance for AI tools

Connector setup: A "Connect your tools" card for an AI assistant. Each app connects inline: it redirects, authorizes and runs a first sync with a progress hairline, then lists the scopes it was granted and offers Disconnect with an inline confirm. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components