Skip to main content
The Trustware widget ships with a default visual style. You can set its color scheme and override its copy to fit your product. Customization happens at two levels: the theme and messages fields in TrustwareConfigOptions, and a handful of props directly on <TrustwareWidget>.

theme field

The theme field sets the widget’s color scheme.
"light" | "dark" | "system"
default:"\"system\""
The color scheme applied to the widget. "system" follows the user’s OS preference.

Example

Color and border radius customization, the primaryColor, backgroundColor, radius, and related fields of the former TrustwareWidgetTheme object, was available through @trustware/sdk 1.1.7 and was replaced by this light, dark, and system setting in 1.1.8. If your project is pinned below 1.1.8, refer to the type definitions shipped with your installed version.

Widget-level theme prop

<TrustwareWidget> accepts a theme prop that takes the same three values.
"light" | "dark" | "system"
Sets the color scheme for this widget instance. In swap mode the prop takes precedence over the theme config field, falling back to "system".
The prop currently applies in swap mode only. In deposit mode the widget reads the color scheme from the theme config field and ignores the prop, so set theme on your config rather than on the component if you need to control the deposit widget’s appearance.

showThemeToggle

boolean
default:"true"
When true, a light/dark mode toggle is rendered inside the widget, letting the user switch modes themselves. Defaults to true. Set to false when your application owns the color scheme and you do not want users to override it from the widget surface.
showThemeToggle applies to deposit mode. The swap mode surface does not render a theme toggle, so the prop has no effect when the widget runs in swap mode.

messages field

The messages field overrides the title and description text rendered at the top of the widget. Both properties are optional.

Default messages

Message properties

string
default:"\"Trustware SDK\""
The heading shown at the top of the widget.
string
The subheading or descriptor shown beneath the title.

Example

Because messages accepts Partial<TrustwareWidgetMessages>, you can override just the title without providing a description, and the SDK will keep the default for the omitted field.