Variables
The variables
property is used to adjust the general styles of the component's base theme, like colors, backgrounds, typography.
Usage
You can customize Clerk components by passing an object of variables to the variables
property of the appearance
prop. You can pass it to the <ClerkProvider>
component to apply it to all Clerk components in your app or you can pass it to a single Clerk component.
Pass variables
to <ClerkProvider>
To customize all Clerk components, pass the variables
property to the appearance
prop to the <ClerkProvider>
component.
In the example below, the primary color is set to red and the text color is set to white. Because these styles are applied to the <ClerkProvider>
, which wraps the entire application, these styles will be applied to all Clerk components that use the primary color and text color.
You can customize 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 example below, the primary color is set to red and the text color is set to white for all instances of the <SignIn />
component.
Pass variables
to a single component
To customize a single Clerk component, pass the variables
property to the appearance
prop to the Clerk component.
- Name
colorPrimary
- Type
string
- Description
The primary color used throughout the components.
- Name
colorDanger
- Type
string
- Description
The color used for error states.
- Name
colorSuccess
- Type
string
- Description
The color used for success states.
- Name
colorWarning
- Type
string
- Description
The color used for warning states.
- Name
colorAlphaShade
- Type
string
- Description
The color that will be used for all to generate the alpha shades the components use. This option applies to borders, backgrounds for hovered elements, hovered dropdown options.
- Name
colorTextOnPrimaryBackground
- Type
string
- Description
The color used for text on the primary background.
- Name
colorTextSecondary
- Type
string
- Description
The color used for secondary text.
- Name
colorBackground
- Type
string
- Description
The background color for the card container.
- Name
colorInputText
- Type
string
- Description
The color used for text in input fields.
- Name
colorInputBackground
- Type
string
- Description
The background color used for input fields.
- Name
fontFamily
- Type
string
- Description
The font family used throughout the components. By default, it is set to
inherit
.
- Name
fontFamilyButtons
- Type
string
- Description
The font family used for buttons. By default, it is set to
inherit
.
- Name
fontSize
- Type
string
- Description
The font size used throughout the components. By default, this is set to
1rem
.
- Name
fontSmoothing
- Type
'auto' | 'antialiased' | 'never'
- Description
The font smoothing used throughout the components. By default, this is set to
auto
.
- Name
fontWeight
- Type
{normal: number, medium: number, bold: number}
- Description
The font weight used throughout the components. By default, this is set to
{normal: 400, medium: 500, bold: 600}
.
- Name
borderRadius
- Type
string
- Description
The border radius used throughout the components. By default, this is set to
0.375rem
.
- Name
spacingUnit
- Type
string
- Description
The spacing unit used throughout the components. By default, this is set to 1rem.
Feedback
Last updated on