Skip to main content
To customise the widget, pass CSS variables through the customCss prop. You can pass a string of CSS declarations or a key-value object — both formats work.

Match your brand colours

Override the primary colour and its interactive states:
To pull in colours from your existing design system, reference your own CSS variables directly:

Set the border radius style

Rounded theme:
Square / no-radius theme:

Set the font family

Monospace:

Configure dark mode

Use the theme prop for light/dark/auto. If you need to override colours for a specific theme, combine theme with customCss:

Advanced: glassmorphism

Advanced: disable default CSS

To apply a fully custom stylesheet without Trails’ defaults interfering:

Global CSS overrides

Variables cascade as normal CSS custom properties. You can set them globally or scope them to a container:

Widget copy overrides

Pass labels to replace the widget’s default copy. Every key is optional, and a blank string falls back to the built-in text.
Overrides apply only to the configured mode’s screens. With mode="fund", a confirmButton override does not follow the user onto the swap sub-screen reached from the fund header.
Destination token pickers keep their own titles, and transient button states — “Enter an amount”, “Getting quote…”, “Connect your wallet”, “Processing…”, “Insufficient Balance” — are never overridden.
Where a modal trigger button is rendered, an explicit buttonText prop takes precedence over labels.confirmButton.
Pass consentCheckbox to render a consent line directly above the primary form button.
Setting the prop makes the tick mandatory — there is no separate required flag. While the box is unticked the button is not disabled by the checkbox; pressing it flags the row instead of submitting, so a ready quote still reads as ready. A failed press moves focus to the checkbox. With requiredMessage set, the notice stands under the row until the box is ticked and is announced to assistive technology. Without it, a failed press shakes and tints the row, and the tint clears itself (both are skipped under prefers-reduced-motion). The row is not a <label>: clicking a link inside the consent line follows the link and does not tick the box. The checkbox renders on the confirm screens of every mode, and is scoped to the configured mode exactly as labels is. Consent is per session and never persisted — a reload asks again, which is what makes the tick evidence of assent rather than a remembered preference.

Label sanitising

label is inline HTML, sanitised against a fixed allowlist:
  • Allowed tags: a, b, strong, i, em, span, br. Every other tag is unwrapped — the tag goes, its text stays — except script, style, template, iframe, object, embed and noscript, which are removed with their contents. Every attribute is stripped.
  • Surviving anchors are rewritten with target="_blank" rel="noopener noreferrer", so following the link never costs the user a filled-in quote.
  • An anchor keeps its href only if that href resolves to http:, https: or mailto: — which includes relative (/terms) and protocol-relative (//host/path) forms. Anything else, such as javascript: or data:, is unwrapped to plain text so nothing inert is left looking clickable.
A blank or whitespace-only label counts as no checkbox at all — and therefore no gate. The SDK logs a console warning when this happens. Bind this to a CMS or i18n value with care.Without DOMParser (server rendering), the label degrades to plain text: all markup is stripped, including allowed tags and links.If you interpolate an untrusted value into an href, validate it yourself. The allowlist is not that check.

CSS variable reference

Typography

Border radius

Widget structure

Primary colours

Background colours

Text colours

Border colours

Interactive states

Status colours

Input fields

Lists