Concepts
Customising the components
Console settings, design tokens, and per-element styling with the appearance prop, from one colour to a component that is entirely yours.
Every ZevAuth component can be made to look like the rest of your product. How far you go is up to you: one colour, a full set of design tokens, or a class on every button and field.
There are four layers, from broadest to narrowest. You can use any mix of them.
| Layer | What it changes | Reach for it when |
|---|---|---|
theme | A whole ready-made look | You want a good starting point and not a design project |
| Console fields | Logo, accent, layout, wording | Someone should be able to change it without a deploy |
variables | Design tokens: colours, font, size, radius, shadow | You want the components to match your design system |
elements | One part at a time: the card, the primary button, every input | A token cannot say it: a weight, a letter-spacing, a hover state |
All of them go in the same appearance object:
<ZevAuthProvider
publishableKey="pk_live_..."
appearance={{
theme: 'soft', // a ready-made look
cardStyle: 'flat', // a console field
variables: { colorPrimary: '#5b3df5' }, // a design token
elements: { buttonPrimary: 'font-semibold' } // one part
}}
>
<App />
</ZevAuthProvider>
Anything you leave out keeps its console value. You can move one setting into your repository without moving the rest.
Where to put it
| Put it on | It applies to |
|---|---|
| The console | Every component and every hosted page, with no deploy |
<ZevAuthProvider appearance> | Every component under that provider |
A component’s appearance prop | That one component |
The narrower setting wins. A component’s appearance beats the
provider’s, and the provider’s beats the console.
<ZevAuthProvider publishableKey="pk_live_..." appearance={{ variables: { colorPrimary: '#5b3df5' } }}>
<SignIn />
{/* Same colour, but this one screen is flat. */}
<SignUp appearance={{ cardStyle: 'flat' }} />
</ZevAuthProvider>
Every component takes appearance: <SignIn>, <SignUp>,
<SignInWithZevId>, <UserButton>, <UserProfile>,
<OrganizationSwitcher> and <OrganizationProfile>.
Merging is deep. A component that sets one variable or one element keeps the provider’s others:
- Variables merge key by key.
- Element classes from both layers are applied together.
- Element styles merge property by property, and the component’s values win.
Themes
A theme is a ready-made look. Pick one by name and override anything you like on top of it:
<ZevAuthProvider publishableKey="pk_live_..." appearance={{ theme: 'soft' }}>
// Soft, but with your own corner radius.
appearance={{ theme: 'soft', variables: { borderRadius: '6px' } }}
No theme sets your brand colour. The accent from the console, or your
colorPrimary, still paints the buttons. Every theme works in light
and dark. Use the switch on each preview to check.
default
A quiet bordered card. This is what you get with no theme.
soft
A raised card with a soft shadow and a little more rounding. The attribution sits in a tinted band along the bottom edge.
minimal
Left-aligned and borderless, with filled fields and no card outline. For products whose own interface is typographic rather than boxed.
sharp
Square corners and firm outlines in the text colour.
contrast
Stronger text, borders and labels, and slightly larger type. Secondary text meets WCAG AA contrast too, not just body text.
How themes combine
A theme sits directly beneath the appearance it’s given in. The full
order, from weakest to strongest:
- The console
- The provider’s
theme - The rest of the provider’s
appearance - A component’s
theme - The rest of that component’s
appearance
So a component can use a different theme from the rest of your app, and your own values always beat a theme given at the same level:
<ZevAuthProvider publishableKey="pk_live_..." appearance={{ theme: 'soft' }}>
<SignIn /> {/* soft */}
<UserProfile appearance={{ theme: 'minimal' }} /> {/* minimal */}
</ZevAuthProvider>
Starting from a theme in code
The themes are exported as plain Appearance objects, so you can read
one, extend it, or show the list in your own settings screen:
import { themes, type Appearance } from '@zevauth/react';
const ours: Appearance = {
theme: themes.soft, // or 'soft'
elements: { title: { letterSpacing: '-0.02em' } },
};
theme also accepts any Appearance of your own. That’s how a team
shares one house style across several apps.
Console fields
These are the settings under Customisation in the console. In
appearance they have the same names, so a value can move between the
two without changing.
The brand
| Field | Values | What it does |
|---|---|---|
accentColor | any hex | Buttons, focus rings, the progress bar |
colorScheme | 'system' 'light' 'dark' | Follows the device, or forces one |
borderRadius | 'none' 'small' 'medium' 'large' 'pill' | Corners on every control |
fontFamily | 'system' 'sans' 'serif' 'mono' | The component font |
logoUrl | a URL | Above the form, and in every auth email |
For any font or radius not in these lists, use
variables.fontFamily or variables.borderRadius. They take
any CSS value, including 'inherit' to use your page’s font.
The form
| Field | Values | What it does |
|---|---|---|
cardStyle | 'card' 'flat' | 'flat' removes the border, background, shadow and padding |
contentAlign | 'center' 'top' | Where the form sits vertically in its space |
showIdentity | true false | Whether your logo and name appear above the form |
showAppName | true false | Whether your name prints under your logo |
If your page already has its own panel, our card is a box inside a box.
cardStyle: 'flat' and showIdentity: false remove ours:
<SignIn appearance={{ cardStyle: 'flat', showIdentity: false }} />
If your app has a fixed header, a centred form can collide with it. Start the form at the top instead:
<SignIn appearance={{ contentAlign: 'top' }} />
The words
| Field | Values | What it does |
|---|---|---|
signInTitle | text, or null | null prints no heading at all |
signInSubtitle | text, or null | Empty by default |
signUpTitle | text, or null | |
signUpSubtitle | text, or null |
<SignIn appearance={{ signInTitle: 'Welcome back', signInSubtitle: 'Sign in to continue.' }} />
<SignIn appearance={{ signInTitle: null }} /> {/* no heading */}
The layout
| Field | Values | What it does |
|---|---|---|
signInLayout | 'centered' 'split_left' 'split_right' | Where the form sits on the page |
signInFullPage | boolean | A centered card takes the whole screen and sits in the middle |
asideStyle | 'gradient' 'solid' 'image' | What the panel beside it is made of |
asideColor / asideColorDark | any hex | The panel colour, in light and dark |
asideImageUrl / asideImageUrlDark | a URL | The panel image, in light and dark |
asideHeading | text | On the panel |
asideText | text | Under the heading |
As a component prop the layout is spelled with a hyphen, like other React
props: <SignIn layout="split-right" />. The prop wins over the field.
The behaviour
| Field | Values | What it does |
|---|---|---|
passwordResetMode | 'dedicated' 'inline' | Whether the password reset gets its own screen |
Variables
Variables are the design tokens every component is drawn with. Each one is a CSS custom property on the component’s root element. Changing one repaints every part that uses it, including hover, focus and disabled states that an inline style can’t reach.
Start with variables. Use elements only for what they can’t express.
appearance={{
variables: {
colorPrimary: '#0f766e',
colorText: '#0f172a',
colorTextSecondary: '#64748b',
colorBorder: '#e2e8f0',
fontFamily: 'inherit',
fontSize: '14px',
borderRadius: '6px',
},
}}
| Variable | Default (light / dark) | Paints |
|---|---|---|
colorPrimary | your console accent | Primary buttons, focus rings, the progress bar, avatars, the split panel |
colorTextOnPrimary | worked out from colorPrimary | Text and icons on primary buttons and avatars |
colorBackground | #ffffff / #18181b | The card and menus |
colorText | #18181b / #fafafa | Headings, labels, menu items |
colorTextSecondary | #71717a / #a1a1aa | Subtitles, hints, dividers, link buttons |
colorBorder | #e4e4e7 / #333338 | Fields, the card, dividers, secondary buttons |
colorInputBackground | #ffffff / #0f0f11 | Text fields |
colorInputText | same as colorText | What people type |
colorInputBorder | same as colorBorder | Text field outlines. Focus and error states still repaint them |
colorDanger | #b91c1c / #f87171 | Errors, invalid fields, field messages |
fontFamily | your console font | Any CSS font-family, e.g. 'inherit' |
fontSize | 13.5px | Field and button text. Every other size scales from it |
borderRadius | your console radius (8px for medium) | Fields and buttons. Cards use 1.5× and menus 1.25× |
cardShadow | none | The card’s box-shadow |
cardWidth | 380px (460px on profile screens) | The card’s width. It still never grows wider than its container |
fontSize sets the base size. Headings, labels, hints and the badge are
all multiples of it, so changing one value keeps the whole component in
proportion.
colorTextOnPrimary is chosen for legibility when you leave it out: near
black on a light primary, white on a dark one. Set it yourself if your
primary isn’t a six-digit hex value, for example oklch(…) or
var(--brand).
Light and dark
Any colour variable can be one value or a { light, dark } pair.
variables: {
colorPrimary: '#5b3df5', // both schemes
colorBackground: { light: '#ffffff', dark: '#0b0b10' }, // one each
colorText: { light: '#111111', dark: '#f4f4f5' },
}
A single value applies in both schemes. That suits an accent, but rarely
a surface: a white card inside a dark page is the clash
colorScheme: 'system' exists to prevent. If you set surface or text
colours, either give pairs or force one scheme with colorScheme.
Using your own CSS variables
Values go straight into CSS, so they can refer to your design system’s variables. The components then follow your theme switch with no extra code:
variables: {
colorPrimary: 'var(--brand-600)',
colorTextOnPrimary: 'white',
colorBackground: 'var(--surface)',
colorText: 'var(--text)',
colorBorder: 'var(--border)',
fontFamily: 'var(--font-sans)',
borderRadius: 'var(--radius)',
}
colorTextOnPrimary is set here because the component can’t work out
legibility from a var().
Elements
elements styles one part of a component. Each key takes a class
name or a style object:
appearance={{
elements: {
label: 'auth-label', // a class name
buttonPrimary: { fontWeight: 600 }, // a style object
zevIdButton: { fontWeight: 600 },
divider: { textTransform: 'uppercase', letterSpacing: '0.08em' },
},
}}
Elements are for details like these, the ones a token can’t express.
Colour, font, size and radius belong in variables, where one value
repaints every part consistently.
A style object is applied inline, so it always beats our stylesheet.
It can’t express :hover, :focus or a media query.
A class name can express all of those, but it has to win against our stylesheet. See Making class names win.
Every element
| Key | The part | Class |
|---|---|---|
root | The outer wrapper of every component | zv-root |
card | The box around a form or profile | zv-card |
identity | Your logo and name, above the form | zv-identity |
logo | Your logo image | zv-logo |
appName | Your name, under the logo | zv-appname |
title | The heading | zv-title |
subtitle | The line under the heading | zv-subtitle |
fields | A group of fields, or a form | zv-fields |
field | One label, input and hint together | zv-field |
label | A field label | zv-label |
input | A text field | zv-input |
hint | Help text under a field | zv-hint |
fieldError | An error under one field | zv-fielderror |
button | Every button | zv-button |
buttonPrimary | The main action: Continue, Create account, Save | zv-button[data-variant='primary'] |
buttonSecondary | Alternatives: email me a link, send a code, Remove | zv-button[data-variant='secondary'] |
buttonLink | Text buttons: Forgot your password?, Back | zv-button[data-variant='ghost'] |
zevIdButton | Continue with ZevID, in <SignIn> and <SignInWithZevId> | |
moreToggle | “More ways to sign in” and other expanders | zv-more |
divider | The “or” between methods | zv-divider |
sectionDivider | The rule between profile sections | zv-section-divider |
alert | An error message for the whole form | zv-alert |
notice | An informational message | zv-notice |
footer | “Don’t have an account? Sign up” | zv-footer |
poweredBy | “Secured by ZevAuth” | zv-poweredby |
testModeBadge | The test mode badge | zv-testmode |
spinner | A loading spinner | zv-spinner |
splitLayout | A split screen’s grid | zv-split |
formPane | The half of a split screen holding the form | zv-formpane |
aside | The other half | zv-aside |
asideHeading | The panel heading | zv-aside-heading |
asideText | The panel text | zv-aside-text |
menuTrigger | The button that opens <UserButton> or <OrganizationSwitcher> | zv-trigger |
menu | The menu that opens | zv-menu |
menuHeader | The signed-in person at the top of the menu | zv-menu-header |
menuItem | One item in the menu | zv-menu-item |
menuLabel | A small heading inside the menu | zv-menu-label |
avatar | A picture, or the initials standing in for one | zv-avatar |
memberList | The members in <OrganizationProfile> | zv-member-list |
memberRow | One member | zv-member |
imageField | The picture control in the profiles | zv-image-field |
imagePreview | The picture itself | zv-image-preview |
progress | The upload progress bar | zv-progress |
buttonDanger | Leave, delete, sign out of other devices | zv-button[data-variant='danger'] |
navigation | The section list in a sidebar profile | zv-nav |
navigationItem | One section in it | zv-nav-item |
panel | The content beside the navigation | zv-panel |
sectionTitle | A heading inside a profile: General, Active devices | zv-section-title |
badge | A small label, such as “This device” | zv-badge |
sessionList | The active devices in <UserProfile showSessions> | zv-session-list |
sessionRow | One device | zv-session |
list | The choices in <OrganizationList> | zv-list |
listItem | One choice | zv-list-item |
modal | A dialog opened from a menu | zv-modal |
modalBackdrop | The dimmed page behind it | zv-modal-backdrop |
userAvatar | The picture in <UserAvatar> only (adds to avatar) |
Keys add to each other from broad to narrow. The primary button gets
button, then buttonPrimary. The ZevID button gets button, then
buttonSecondary, then zevIdButton. Where two style objects set the same
property, the narrower key wins.
<UserButton> and <OrganizationSwitcher> share the menu keys. To style
one without the other, pass appearance to that component instead of
the provider:
<UserButton appearance={{ elements: { avatar: 'ring-2 ring-white' } }} />
Making class names win
Our stylesheet is written so that ordinary rules on your page can’t
reach into the components by accident. For example, a global
h1 { color: white } doesn’t turn our heading white. The same strength
means a plain utility class in elements can lose to our rule for the
same property.
There are three ways to make your classes win. They are listed from most to least recommended.
1. Put our stylesheet in a cascade layer. Unlayered CSS beats layered
CSS whatever its specificity. With cssLayerName, our rules sit in a
layer that you place before your own:
<ZevAuthProvider publishableKey="pk_live_..." appearance={{ cssLayerName: 'zevauth' }}>
Then declare the order once in your CSS. For Tailwind v4, whose utilities live in a layer of their own:
@layer theme, base, zevauth, components, utilities;
@import 'tailwindcss';
Now elements: { buttonPrimary: 'bg-indigo-600 hover:bg-indigo-500' }
wins with no !important. Set cssLayerName on the provider. The
stylesheet is shared by every component on the page, so it is read once,
when the first component renders.
2. Use !important. Tailwind’s ! prefix does it per class, and it
works in any setup, including Tailwind v3:
elements: { buttonPrimary: '!bg-indigo-600 hover:!bg-indigo-500' }
3. Use a style object for anything that doesn’t need a state or a breakpoint. Inline styles always win.
Styling from a stylesheet
Every class in the table above is part of the public API. It won’t be
renamed in a minor release. You can style the components from your own
CSS without touching appearance at all:
.zv-root .zv-card { border-width: 2px; }
.zv-root .zv-button[data-variant='primary']:hover { filter: brightness(1.1); }
Prefix your selectors with .zv-root so they match the strength of
ours. The state is exposed as attributes, so you can target it without
adding classes:
| Attribute | On | Values |
|---|---|---|
data-theme | zv-root | light dark: the scheme being painted |
data-variant | zv-button | primary secondary ghost danger |
data-chrome | zv-card | card flat |
data-layout | zv-card | sidebar on sidebar profiles |
data-size | zv-card | wide on the profile screens |
data-form | zv-split | left right: which side the form is on |
data-align | zv-formpane | center top |
aria-invalid | zv-input | true when the field has an error |
aria-expanded | zv-more, zv-trigger | true while open |
disabled | buttons and inputs | while a request is in flight |
One theme, shared
Appearance is exported, so a theme can live in its own file and be
type-checked:
// auth-theme.ts
import type { Appearance } from '@zevauth/react';
export const authTheme: Appearance = {
theme: 'soft',
cssLayerName: 'zevauth',
variables: {
colorPrimary: 'var(--brand-600)',
colorTextOnPrimary: 'white',
fontFamily: 'inherit',
borderRadius: '10px',
},
elements: {
buttonPrimary: 'font-semibold hover:bg-[var(--brand-700)]',
input: 'focus:ring-2 focus:ring-[var(--brand-200)]',
},
};
<ZevAuthProvider publishableKey="pk_live_..." appearance={authTheme}>
AppearanceVariables, AppearanceElements, AppearanceElementKey and
ThemedColor are exported too, for building a theme up from parts.
Recipes
Blend into a page you already designed
Remove our chrome and take your page’s font and colours. What’s left is the fields and buttons:
<SignIn
appearance={{
cardStyle: 'flat',
showIdentity: false,
variables: { fontFamily: 'inherit', colorText: 'inherit' },
}}
/>
Larger, for a touch-first product
Raise the base size and everything follows it: headings, labels, hints and the badge.
appearance={{ variables: { fontSize: '16px', cardWidth: '420px' } }}
A dark brand, only in dark mode
appearance={{
variables: {
colorPrimary: { light: '#4f46e5', dark: '#a5b4fc' },
colorBackground: { light: '#ffffff', dark: '#0c0a1d' },
colorBorder: { light: '#e5e7eb', dark: '#27224a' },
},
}}
Split screens and your own panel
The panel beside a split form has its own dark variants, because a colour or photo chosen for a light page is often wrong on a dark one:
appearance={{
asideStyle: 'gradient',
asideColor: '#5b3df5', // light mode
asideColorDark: '#1a1440', // dark mode
}}
aside takes any JSX and replaces the console’s panel. useZevTheme()
tells your panel which scheme is painting, resolved the same way the
components resolve it:
import { SignIn, useZevTheme } from '@zevauth/react';
function Panel() {
const isDark = useZevTheme();
return <img src={isDark ? '/hero-dark.jpg' : '/hero-light.jpg'} alt="" />;
}
<SignIn layout="split-right" aside={<Panel />} appearance={{ elements: { aside: 'p-0' } }} />
Server rendering
The components add their stylesheet to the page when they first render.
A server-rendered page needs it in the HTML instead, or the form
flashes unstyled until hydration. Render it once in your document head.
With cssLayerName, use getComponentStyles so the server sends the
same layered CSS:
// Next.js: '@zevauth/nextjs/server'. Any other React app: '@zevauth/react/styles'.
import { componentStyleId, getComponentStyles } from '@zevauth/nextjs/server';
<style
id={componentStyleId}
dangerouslySetInnerHTML={{ __html: getComponentStyles({ cssLayerName: 'zevauth' }) }}
/>
componentStyles is the same CSS without a layer.
Beyond appearance
When you need different markup, not just a different look, build the
screen yourself. The hooks and the client expose everything the
components use: useAuth,
useUser, client.signIn and client.signUp in
the JavaScript SDK. You can also keep our pieces
inside your own layout: <SignInWithZevId> is the SSO button alone, and
<ImageField> is the profile picture control alone.
One thing you cannot set
showPoweredBy is not part of appearance. Whether “Secured by ZevAuth”
appears is decided on the server from your plan. Any attempt to set it in
code is dropped, including from plain JavaScript where no types stop it.
Hiding the poweredBy element with CSS breaches the terms of the plans
that include it.
Removing the badge is a paid feature. Once your plan includes it, turn it off under Customisation → Badge in the console. Development environments always show it, so you never design against a screen that production won’t give you.
Updated at, Tuesday, November 24, 2026