Customizing Torii
Torii’s components are customized through a single prop,
appearance on <ToriiProvider>, plus the
labels system for text. Everything is consumer-driven: the SDK does not
fetch theming from the server, so your provider props are the only source of
truth.
There are no CSS imports, no Tailwind requirement, and no className
plumbing. The SDK emits its own scoped <style> block under the .torii root
and honours your app’s existing .dark class for dark mode.
The layered model
Section titled “The layered model”Customization is layered, in order of increasing specificity. Reach for the lowest layer that does the job:
- Theme: pick a baseline palette. A preset name (
'shadcn' | 'mui') or a fullThemeobject bundling light + dark token sets. - Variables: override individual design tokens (a color, the radius, the font) on top of the theme. Applies to both light and dark modes.
- Elements: attach a class name or inline style to a named component slot when tokens aren’t enough (e.g. fully-rounded buttons, a custom shadow).
<ToriiProvider publishableKey="pk_live_…" appearance={{ theme: 'shadcn', // 1. baseline palette variables: { primary: '262 83% 58%' }, // 2. token override elements: { formButtonPrimary: 'rounded-full' }, // 3. per-slot class }}> <App /></ToriiProvider>Resolution per render: preset baseline → variables layered on top → elements
applied at render time.
| Layer | Prop | Scope | When to use |
|---|---|---|---|
| Theme | appearance.theme | Whole palette | Match your component library or ship a full custom theme. |
| Variables | appearance.variables | Individual tokens | Tweak one or two colors / the radius without authoring a theme. |
| Elements | appearance.elements | Named slots | Per-element class or inline-style overrides. |
→ Full details: theming · elements & slots
Text & translations
Section titled “Text & translations”Visual styling and copy are separate axes. All user-facing text flows through
the labels system; no string is ever hardcoded. Pass a languages array
to <ToriiProvider> for built-in en / da with browser auto-detection, or
override any subset of keys per component via the labels prop.
Server-controlled surfaces
Section titled “Server-controlled surfaces”A few things are deliberately not consumer-customizable, because the server enforces them per environment / billing tier:
- The “Powered by Torii.so” footer is required on lower tiers. The
appearance.hideFooterflag is honoured only when the server’s branding gate allows it (builder-tier orgs): a downgraded org can’t accidentally hide it. Its styling is still themeable via thepoweredByelement slot. - Legal consent links (Terms / Privacy) come from the environment’s configured URLs, surfaced on the sign-up form.
- MitID button copy is constrained to the wordings mandated by the Danish Agency for Digitalisation (see labels).
See also
Section titled “See also”- Theming: presets, the full token list, dark mode
- Elements & slot overrides: per-component classes/styles
- Labels & i18n: translating text, custom copy