Themes
Clerk currently offers four prebuilt themes:
Default theme
Applied by default when no other theme is provided.
Usage
-
To get started, install the
@clerk/themes
package. -
To use a theme, import it from
@clerk/themes
and pass it to theappearance
prop of a Clerk component.
Apply a theme to all Clerk components
To apply a theme to all Clerk components, pass the appearance
prop to the <ClerkProvider>
component. The appearance
prop accepts the property baseTheme
, which can be set to a theme.
In the following example, the "Dark" theme is applied to all Clerk components.
Apply multiple themes
You can also stack themes by passing an array of themes to the baseTheme
property of the appearance
prop. The themes will be applied in the order they are listed. If styles overlap, the last defined theme will take precedence.
In the following example, the "Dark" theme is applied first, then the "Neobrutalism" theme is applied on top of it.
Apply a theme to all instances of a Clerk component
You can apply a theme to all instances of a Clerk component by passing the component to the appearance
prop of the <ClerkProvider>
. The appearance
prop accepts the name of the Clerk component you want to style as a key.
In the following example, the "Neobrutalism" theme is applied to all instances of the <SignIn />
component.
Apply a theme to a single Clerk component
To apply a theme to a single Clerk component, pass the appearance
prop to the component. The appearance
prop accepts the property baseTheme
, which can be set to a theme.
Customize a theme using variables
You can customize a theme by passing an object of variables to the variables
property of the appearance
prop. The variables
property is used to adjust the general styles of the component's base theme, like colors, backgrounds, typography.
In the following example, the primary color of the themes are customized.
Feedback
Last updated on