Settings
Analytics account banner
The "Connected account" card shown under an analytics pane's header, displaying the authenticated login, an account picker, and a disconnect action.
Available
Ports as-is
Examples
Rendered live from the maintained Storybook story. Lantern stores only the story id and embeds Storybook rather than duplicating the component or its demo.
Analytics account banner
Rendered live from Storybook
Storybook must be running for this to load — bun run start:storybook from the monorepo root, or set NEXT_PUBLIC_STORYBOOK_URL to a deployed instance.
Props
The component's public API, read from its TypeScript source. Descriptions come from TSDoc on the prop, so this table cannot drift from the component.
| Prop | Type | Default | Description |
|---|---|---|---|
accountLabel* | React.ReactNode | — | Bold line under "Connected account" — the authenticated login, e.g. `Meta Business Suite (123-***-456)`. |
caption | React.ReactNode | "Connected account" | Small line above it. |
accounts | AnalyticsAdAccount[] | [] | Accounts available under that login. |
selectedAccountId | string | — | Controlled selection. Pair with `onSelectedAccountIdChange`. |
defaultSelectedAccountId | string | — | Uncontrolled initial selection — lets each selection be a static story. |
onSelectedAccountIdChange | (id: string) => void | — | Undocumented — add TSDoc to the prop in the library. |
placeholder | string | "Select account…" | Undocumented — add TSDoc to the prop in the library. |
onDisconnect | () => void | — | Fires from the overflow menu's Disconnect item. |
disconnectLabel | React.ReactNode | "Disconnect" | Undocumented — add TSDoc to the prop in the library. |
onCreateAccount | () => void | — | Adds GA4's "Create account" affordance above the options. Omit to hide the row. |
createAccountLabel | React.ReactNode | "Create account" | Undocumented — add TSDoc to the prop in the library. |
className | string | — | Undocumented — add TSDoc to the prop in the library. |
Reference
Transcribed from the component audit. If this disagrees with the source, the source is right.
- Source
src/components/settings/analytics/AnalyticsAccountBanner.tsx- Portability
- Copies across unchanged — only the utils import path moves.
- Notes
- Use it inside any analytics integration pane that needs to show which login is attached and let the operator switch which account under it is active; pass accounts and selection as props, and supply onCreateAccount only for integrations, like GA4, that let the operator create a new account from the picker.