Skip to content
Torii docs

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-in torii-* class (so cascading stylesheets, Tailwind, CSS modules all work).
  • CSSProperties: applied as inline style (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.

Slots are part of the public API: they won’t be removed or renamed across minor versions.

SlotSurface
cardAny card container (sign-in, sign-up, forgot, profile)
headerTitleMain heading inside the card
headerSubtitleSecondary heading inside the card
formFieldLabelEach input’s label
formFieldInputEach text / email / password input
formFieldErrorPer-field validation error
formErrorForm-level error (e.g. bad credentials)
formButtonPrimaryPrimary submit / save button
socialButtonEach OAuth / SSO button
dividerTextThe “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)”
SlotSurface
menuContentPopup / dropdown container (user button, language select)
menuItemRow inside a popup / dropdown
menuSeparatorVisual separator between menu groups
tabListTab strip (user dashboard)
tabTriggerIndividual tab button
modalBackdropDimmed overlay behind a modal (UserProfile modal)
modalContentThe centered modal panel
modalCloseButtonThe ✕ button on a modal
listItemRow in a list (connected accounts, sessions)
secondaryButtonNon-primary actions (Cancel, Edit)
destructiveButtonDangerous actions (Sign out, Disconnect, Delete)
poweredBy”Powered by Torii.so” footer under auth cards (styling only, always rendered)
<ToriiProvider
publishableKey="pk_live_…"
appearance={{
elements: {
formButtonPrimary: 'rounded-full font-semibold',
socialButton: 'rounded-full',
},
}}
>
<AuthCard />
</ToriiProvider>
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.

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). The card slot intentionally hits every card; the per-surface classes are the per-screen escape hatch.
  • “I want to restyle my SSO buttons.”socialButton applies 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).

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.

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:

SurfacePer-surface class
Sign-in cardtorii-sign-in-card
Sign-up cardtorii-sign-up-card
Forgot-password cardtorii-forgot-card
User profile cardtorii-profile-card
Organization listtorii-org-list
Organization profiletorii-org-profile
Create organizationtorii-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.

  • Theming: presets, variables, token list