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:Set the border radius style
Rounded theme:Set the font family
Configure dark mode
Use thetheme 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
Passlabels 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.
buttonText prop takes precedence over labels.confirmButton.
Consent checkbox
PassconsentCheckbox 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 — exceptscript,style,template,iframe,object,embedandnoscript, 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
hrefonly if that href resolves tohttp:,https:ormailto:— which includes relative (/terms) and protocol-relative (//host/path) forms. Anything else, such asjavascript:ordata:, is unwrapped to plain text so nothing inert is left looking clickable.