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 additionalSections aren't scope-gated. An id that collides with a built-in section is ignored; use that section's *Content prop instead.
  • The Help "Contact Us" line is hidden until you set helpContactUrl, and the Profile contact line is unlinked until you set profileContactUrl.
  • The widget reads no URL or router; you own navigation via selectedSection and onSelectedSectionChange.

Props

Widget props

PropTypeDefaultDescription
acceptInviteRedirectUristringSame-origin /accept-inviteWhere Team invite emails link to; set it when your landing route differs or the origin isn't allowlisted.
profileContentSlotReactNodeProfile widgetReplaces the profile section content.
teamContentSlotReactNodeTeam widgetReplaces the team section content.
invoiceContentSlotReactNodeInvoice settings widgetReplaces invoice settings content.
billPayContentSlotReactNodeApproval policies settingsReplaces bill-pay settings content.
accountingContentSlotReactNodeChart of accounts widgetReplaces accounting content.
expenseContentSlotReactNodeExpense policies and requirementsReplaces expense content.
legalContentSlotReactNodeBank disclosures widgetReplaces the Legal section content.
profileContactUrlstringundefinedLink for the Profile section's "contact your bank" line; unlinked when unset.
selectedSectionControlledSettingsWidgetSectionIdundefinedThe section to show (controlled). Pair with onSelectedSectionChange; leave unset to let the widget own it.
defaultSelectedSectionUncontrolledSettingsWidgetSectionIdFirst visible sectionThe section to open on; read once per mount and ignored when selectedSection is set.
onSelectedSectionChangeEvent
(section: SettingsWidgetSectionId) => void
(section: SettingsWidgetSectionId) => void
undefinedCalled with the section the user selected, whether or not selectedSection is supplied.
additionalSectionsSettingsWidgetAdditionalSection[]undefinedHost-owned { id, label, content, after? } sections; after names the built-in section to place it behind.
helpContactUrlstringundefinedLink (URL or mailto:) for the Help section's "Contact Us" line; hidden when unset.
helpFaqHelpFaqSection[]HELP_FAQ_ENFAQ shown in the Help section. Extend the exported HELP_FAQ_EN to add your own questions.
helpContentSlotReactNodeHelp widgetReplaces the help section content.
Label overrides
PropTypeDefaultDescription
labelsLabelsPartial<Labels>English labelsOverrides the settings heading copy.
featureLabelsLabelsPartial<FeatureLabels>English labelsOverrides 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.

On this page