Settings
A single navigable settings surface combining profile, team, invoice, bill-pay, expense, accounting, legal and help sections.
Part ofEmbedded BankingandFinOps
A single navigable settings surface combining profile, team, invoice, bill-pay, expense, accounting, legal and help sections.
Quick Start
import { SettingsWidget } from '@tesouro/embedded-components-react';
export function SettingsPage() {
return (
<SettingsWidget
baseUrl="https://api.example.com"
widgetToken="wt_live_abc123"
organizationId="org_xyz"
/>
);
}Behaviour
- Most built-in sections are scope-gated, and scopes arrive with widget init. A section the user's scopes hide falls back to the first visible one, and nothing is reported through
onSelectedSectionChange, so your URL can name a section the user isn't looking at. - Sections from
additionalSectionsaren't scope-gated. An id that collides with a built-in section is ignored; use that section's*Contentprop instead. - The Help "Contact Us" line is hidden until you set
helpContactUrl, and the Profile contact line is unlinked until you setprofileContactUrl. - The widget reads no URL or router; you own navigation via
selectedSectionandonSelectedSectionChange.
Props
Widget props
| Prop | Type | Default | Description |
|---|---|---|---|
acceptInviteRedirectUri | string | Same-origin /accept-invite | Where Team invite emails link to; set it when your landing route differs or the origin isn't allowlisted. |
profileContentSlot | ReactNode | Profile widget | Replaces the profile section content. |
teamContentSlot | ReactNode | Team widget | Replaces the team section content. |
invoiceContentSlot | ReactNode | Invoice settings widget | Replaces invoice settings content. |
billPayContentSlot | ReactNode | Approval policies settings | Replaces bill-pay settings content. |
accountingContentSlot | ReactNode | Chart of accounts widget | Replaces accounting content. |
expenseContentSlot | ReactNode | Expense policies and requirements | Replaces expense content. |
legalContentSlot | ReactNode | Bank disclosures widget | Replaces the Legal section content. |
profileContactUrl | string | undefined | Link for the Profile section's "contact your bank" line; unlinked when unset. |
selectedSectionControlled | SettingsWidgetSectionId | undefined | The section to show (controlled). Pair with onSelectedSectionChange; leave unset to let the widget own it. |
defaultSelectedSectionUncontrolled | SettingsWidgetSectionId | First visible section | The section to open on; read once per mount and ignored when selectedSection is set. |
onSelectedSectionChangeEvent |
| undefined | Called with the section the user selected, whether or not selectedSection is supplied. |
additionalSections | SettingsWidgetAdditionalSection[] | undefined | Host-owned { id, label, content, after? } sections; after names the built-in section to place it behind. |
helpContactUrl | string | undefined | Link (URL or mailto:) for the Help section's "Contact Us" line; hidden when unset. |
helpFaq | HelpFaqSection[] | HELP_FAQ_EN | FAQ shown in the Help section. Extend the exported HELP_FAQ_EN to add your own questions. |
helpContentSlot | ReactNode | Help widget | Replaces the help section content. |
Label overrides
| Prop | Type | Default | Description |
|---|---|---|---|
labelsLabels | Partial<Labels> | English labels | Overrides the settings heading copy. |
featureLabelsLabels | Partial<FeatureLabels> | English labels | Overrides section labels. |
Examples
Deep-linking to a section
const section = searchParams.get('section') ?? undefined;
<SettingsWidget
selectedSection={section}
onSelectedSectionChange={(next) =>
router.replace(`/settings?section=${next}`)
}
/>;To open on a section without owning the selection, use defaultSelectedSection={SettingsSection.Team} on its own.
Contributing a section
<SettingsWidget
additionalSections={[
{
id: 'security',
label: 'Security',
content: <SecurityPage />,
after: SettingsSection.Profile,
},
]}
/>TypeScript
import {
SettingsSection,
type SettingsWidgetProps,
type SettingsWidgetSectionId,
type SettingsWidgetAdditionalSection,
type SettingsWidgetLabels,
type SettingsWidgetFeatureLabels,
} from '@tesouro/embedded-components-react';SettingsSection names the built-in section ids: profile, team, invoice, expense, bill-pay, accounting, legal, help.