Elements & slot overrides
The appearance.elements prop lets you attach a class name or an inline-style object to any named slot in the SDK’s component tree. Use this when a preset + a few token tweaks aren’t enough, e.g. you want the primary button to be fully rounded, or the card to have a specific shadow.
appearance={{ elements: { card: 'my-card-class', formButtonPrimary: { borderRadius: '9999px', fontWeight: 600 }, },}}Each slot accepts either:
string: appended to the element’s built-intorii-*class (so cascading stylesheets, Tailwind, CSS modules all work).CSSProperties: applied as inlinestyle(wins over stylesheets via specificity).
Apply one slot across every relevant component, e.g. formButtonPrimary styles the submit button on sign-in, sign-up, forgot-password, and profile save alike. That is intentional: consistency is the whole point of the slot system.
Stable slot list
Section titled “Stable slot list”Slots are part of the public API: they won’t be removed or renamed across minor versions.
Auth surfaces (pre-sign-in)
Section titled “Auth surfaces (pre-sign-in)”| Slot | Surface |
|---|---|
card | Any card container (sign-in, sign-up, forgot, profile) |
headerTitle | Main heading inside the card |
headerSubtitle | Secondary heading inside the card |
formFieldLabel | Each input’s label |
formFieldInput | Each text / email / password input |
formFieldError | Per-field validation error |
formError | Form-level error (e.g. bad credentials) |
formButtonPrimary | Primary submit / save button |
socialButton | Each OAuth / SSO button |
dividerText | The “or” divider between social and password |
forgotPasswordLink | ”Forgot password?” link |
footerActionLink | ”Sign up” / “Sign in” toggle at the bottom |
Post-auth surfaces (user profile / dashboard)
Section titled “Post-auth surfaces (user profile / dashboard)”| Slot | Surface |
|---|---|
menuContent | Popup / dropdown container (user button, language select) |
menuItem | Row inside a popup / dropdown |
menuSeparator | Visual separator between menu groups |
tabList | Tab strip (user dashboard) |
tabTrigger | Individual tab button |
modalBackdrop | Dimmed overlay behind a modal (UserProfile modal) |
modalContent | The centered modal panel |
modalCloseButton | The ✕ button on a modal |
listItem | Row in a list (connected accounts, sessions) |
secondaryButton | Non-primary actions (Cancel, Edit) |
destructiveButton | Dangerous actions (Sign out, Disconnect, Delete) |
poweredBy | ”Powered by Torii.so” footer under auth cards (styling only, always rendered) |
Example: rounded-pill Tailwind buttons
Section titled “Example: rounded-pill Tailwind buttons”<ToriiProvider publishableKey="pk_live_…" appearance={{ elements: { formButtonPrimary: 'rounded-full font-semibold', socialButton: 'rounded-full', }, }}> <AuthCard /></ToriiProvider>Example: inline-style escape hatch
Section titled “Example: inline-style escape hatch”appearance={{ elements: { card: { boxShadow: '0 20px 60px -20px rgba(0,0,0,0.18)', border: '1px solid rgba(0,0,0,0.04)', }, headerTitle: { letterSpacing: '-0.02em' }, },}}Use inline styles when the class path would be awkward (e.g. you don’t have a CSS framework set up); they win over the SDK’s stylesheet via standard CSS specificity rules.
Picking the right slot
Section titled “Picking the right slot”Before reaching for a new slot, check the existing list. A few recurring patterns:
- “I want to change all the cards.” →
card. - “…only the sign-in card.” → target the per-surface class in your CSS:
.torii-sign-in-card { … }(see Per-surface card classes below). Thecardslot intentionally hits every card; the per-surface classes are the per-screen escape hatch. - “I want to restyle my SSO buttons.” →
socialButtonapplies to every OAuth / SSO button across sign-in and sign-up. - “I want one button in the profile to be red.” →
destructiveButton(it’s already wired for Sign out, Disconnect, Delete).
Stable torii-* class names
Section titled “Stable torii-* class names”Every slot has a stable built-in class (e.g. torii-card, torii-btn-primary) that you can also target from a global stylesheet. Renaming one is treated as a breaking change, so it’s safe to rely on for CSS-only overrides if you don’t want to use the prop API.
Per-surface card classes
Section titled “Per-surface card classes”The card slot styles every card. When you want to restyle one specific card, each card also carries a stable per-surface class alongside the shared torii-card, so you can scope a plain CSS rule to it:
| Surface | Per-surface class |
|---|---|
| Sign-in card | torii-sign-in-card |
| Sign-up card | torii-sign-up-card |
| Forgot-password card | torii-forgot-card |
| User profile card | torii-profile-card |
| Organization list | torii-org-list |
| Organization profile | torii-org-profile |
| Create organization | torii-create-org |
/* Give only the sign-in card a tinted background; leave sign-up untouched. */.torii-sign-in-card { background: linear-gradient(180deg, #faf5ff, #ffffff);}These are additive: torii-card still applies the base styling, and the card slot override still layers on top. Like the slot classes, they’re stable across minor versions.
See also
Section titled “See also”- Theming: presets, variables, token list