Search…
Customization
Learn to customize the look and feel of Clerk's components to match your application.

Overview

When your users are going through the authentication process, you need to make sure they have a seamless experience. Clerk allows you to customize the look and feel of your components to match the rest of your application using theming options.
By using the theming options, you can change visual elements of your authentication flow like:
    Font colors
    Button colors
    Border styles
    and more...
The customization options detailed here are a code-side alternative to instance-level theming configured through the Clerk dashboard. Every theming option provided at code-side will be merged with the theming defined in your application dashboard.
Components can be customized with the theme prop or by defining Clerk-specific CSS variables. Both ways are described in this guide.
Customization options have an order of precedence from which overrides are applied. This precedence order is shown below: 1. CSS Variables (takes precedence over) 2. theme prop (takes precedence over)3. Dashboard settings

Using the theme prop

To customize your components using the theme prop, you need to provide an object to <ClerkProvider /> with the parameters you wish to change.
React JSX
React TSX
1
import { ClerkProvider } from "@clerk/clerk-react";
2
3
const customTheme = {...};
4
5
function App(){
6
7
return (
8
<ClerkProvider theme={customTheme}>
9
{/* Your wrapped application. */}
10
</ClerkProvider>
11
);
12
}
Copied!
1
import { ClerkProvider } from "@clerk/clerk-react";
2
import { ClerkThemeOptions } from "@clerk/types"
3
4
const customTheme: ClerkThemeOptions = {...};
5
6
function App(){
7
8
return (
9
<ClerkProvider theme={customTheme}>
10
{/* Your wrapped application. */}
11
</ClerkProvider>
12
);
13
}
Copied!
Now all components rendered as a child of <ClerkProvider /> will inherit the theme options you have defined. There is no need to change any individual component, the theme changes are applied automatically.

Custom theme properties

The theme object should conform to the ClerkThemeOptions interface. An example of the options you can pass on the theme prop is shown below:
1
const customThemeOptions = {
2
general: {
3
/* Primary color */
4
color: "#f1f1f1",
5
6
/* Components background color */
7
backgroundColor: "#f2f2f2",
8
9
/* Components font color */
10
fontColor: "#f3f3f3",
11
12
/* Components font family */
13
fontFamily: "Inter, sans serif",
14
15
/* Components label font weight */
16
labelFontWeight: "500",
17
18
/* Padding mod for selected Clerk elements */
19
padding: "1em",
20
21
/* Border radius for selected Clerk elements */
22
borderRadius: "20px",
23
24
/* Box shadow applied on form Clerk components */
25
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.2)",
26
},
27
buttons: {
28
/* Clerk buttons font color */
29
fontColor: "#f4f4f4",
30
31
/* Clerk buttons font family */
32
fontFamily: "Inter, sans serif"
33
34
/* Clerk buttons font weight */
35
fontWeight: "300",
36
},
37
}
Copied!

Using CSS variables

To customize components using CSS variables, you need to define the properties you wish to override under the .cl-component scope.
1
.cl-component {
2
// your Clerk theming options go here
3
}
Copied!

Available CSS variables

The available CSS variables you can override can be seen below:
1
.cl-component {
2
/* Primary color */
3
--clerk-primary: #335bf1;
4
5
/* Components background color */
6
--clerk-background-color: #ffffff;
7
8
/* Components font color */
9
--clerk-font-color: #151515;
10
11
/* Components font family */
12
--clerk-font-family: "Inter", sans-serif;
13
14
/* Components label font weight */
15
--clerk-label-font-weight: 600;
16
17
/* Padding mod for selected Clerk elements */
18
--clerk-padding-mod: 1;
19
20
/* Border radius for selected Clerk elements */
21
--clerk-border-radius: 0.5em;
22
23
/* Box shadow applied on form Clerk components */
24
--clerk-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
25
26
/* Clerk buttons font color */
27
--clerk-button-font-color: #ffffff;
28
29
/* Clerk buttons font family */
30
--clerk-button-font-family: "Inter", sans-serif;
31
32
/* Clerk buttons font weight */
33
--clerk-button-font-weight: 600;
34
}
Copied!

Showcase

Below you can find three different examples showcasing the capabilities of Clerk's theme customization.
Futuristic
Professional
Hearty
1
// Supplying a theme prop
2
const futuristicThemeOptions = {
3
general: {
4
color: "#05f4b7",
5
backgroundColor: "#12151f",
6
fontColor: "#05f4b7",
7
borderRadius: "20px",
8
boxShadow: "2px 4px 12px #05f4b7",
9
},
10
buttons: {
11
fontColor: "#fff",
12
},
13
}
14
15
16
17
// Using CSS variables.
18
.cl-component {
19
--clerk-border-radius: 20px;
20
--clerk-primary: #05f4b7;
21
--clerk-font-color: #05f4b7;
22
--clerk-background-color: #12151f;
23
--clerk-button-font-color: #fff;
24
--clerk-box-shadow: 2px 4px 12px #05f4b7;
25
}
Copied!
1
// Supplying a theme prop
2
const professionalThemeOptions = {
3
general: {
4
color: "#fb8122",
5
backgroundColor: "#e1e2e2",
6
fontColor: "#1d2228",
7
labelFontWeight: "300",
8
borderRadius: "0px",
9
},
10
buttons: {
11
fontColor: "#fff",
12
},
13
}
14
15
16
17
// Using CSS variables.
18
.cl-component {
19
--clerk-border-radius: 0px;
20
--clerk-primary: #fb8122;
21
--clerk-font-color: #1d2228;
22
--clerk-label-font-weight: 300;
23
--clerk-background-color: #e1e2e2;
24
--clerk-button-font-color: #fff;
25
}
Copied!
1
// Supplying a theme prop
2
const heartyThemeOptions = {
3
general: {
4
color: "#ef0d50",
5
backgroundColor: "#e1f2f7",
6
fontColor: "#ef0d50",
7
labelFontWeight: "bold",
8
borderRadius: "12px",
9
boxShadow: "10px 0px 12px 6px #ef0d50",
10
},
11
buttons: {
12
fontColor: "#fff",
13
},
14
}
15
16
// Using CSS variables.
17
.cl-component {
18
--clerk-border-radius: 12px;
19
--clerk-primary: #ef0d50;
20
--clerk-font-color: #ef0d50;
21
--clerk-label-font-weight: bold;
22
--clerk-background-color: #e1f2f7;
23
--clerk-button-font-color: #fff;
24
--clerk-box-shadow: 10px 0px 12px 6px #ef0d50;
25
}
Copied!

Need more?

If you need more customization capabilities for your use-case, please reach out to any of our community channels. We are constantly evaluating new customization options and would love to hear your feedback!
If you require complete customization, you can also implement ClerkJS custom flows, which leverage the same underlying APIs that are used to build our components.
Last modified 16d ago