UI components are fully customizable so you can match your app's branding.
What you can customize in the pre-built authentication component:
- Overall theme: colors, radius, illustrations, custom css
- Header: text, logo, custom component
- External wallet connectors: featured wallets, specify order, chain filtering (EVM/Solana), WalletConnect, and more via
configForExternalWallets(). See EOA connectors for more details.
Need to set up Tailwind first? See the complete Tailwind setup guide for installation and configuration instructions.
See the UI components guide for details on configuring your UI components.
Theme customizations and styling are passed through withAccountKitUi, the Account Kit Tailwind plugin, in your tailwind.config.js file.
The Account Kit Theme object passed to withAccountKitUi supports an overridable colors object which accepts a set of color values. Each color is a key-value pair where the key is the name of the color and the value is an object containing the light and dark mode value to use.
active- the color of the border when the input is focusedstatic- the color of the border when the input is not focusedcritical- the color of the border when the input is in an error state
These colors affect the background of buttons
btn-primary- the color of the primary buttonbtn-secondary- the color of the secondary buttonbtn-auth- the color of the authentication button
These colors primarily affect the text color of the components
fg-primary- the color of the primary textfg-secondary- the color of the secondary textfg-tertiary- the color of the tertiary textfg-invert- the color of the inverted textfg-disabled- the color of the disabled textfg-accent-brand- your brand colorfg-critical- the color of the critical text
These colors affect the background of various components (eg. modal, inputs, etc)
bg-surface-default- the default background colorbg-surface-subtle- a subtle background colorbg-surface-inset- the background color of inset componentsbg-surface-critical- the background color of critical componentsbg-surface-error- the background color of error componentsbg-surface-success- the background color of success componentsbg-surface-warning- the background color of warning components
import { withAccountKitUi, createColorSet } from "@account-kit/react/tailwind";
export const tailwindConfig = withAccountKitUi(
{
content: [],
// your tailwind config
},
{
colors: {
active: createColorSet("#94A3B8", "#94A3B8"),
},
},
);You can customize multiple color properties at once for comprehensive theming:
import { withAccountKitUi, createColorSet } from "@account-kit/react/tailwind";
export default withAccountKitUi(
{
content: ["./src/**/*.{js,ts,jsx,tsx,mdx}"],
},
{
colors: {
"btn-primary": createColorSet("#3b82f6", "#1d4ed8"),
"fg-accent-brand": createColorSet("#3b82f6", "#60a5fa"),
active: createColorSet("#94a3b8", "#94a3b8"),
},
},
);Account Kit supports these color customizations:
Border Colors:
active- Border color when input is focusedstatic- Border color when input is not focusedcritical- Border color for error states
Button Colors:
btn-primary- Primary button backgroundbtn-secondary- Secondary button backgroundbtn-auth- Authentication button background
Text Colors:
fg-primary- Primary text colorfg-secondary- Secondary text colorfg-tertiary- Tertiary text colorfg-invert- Inverted text colorfg-disabled- Disabled text colorfg-accent-brand- Brand accent colorfg-critical- Critical/error text color
Background Colors:
bg-surface-default- Default backgroundbg-surface-subtle- Subtle backgroundbg-surface-inset- Inset component backgroundbg-surface-critical- Critical component backgroundbg-surface-error- Error component backgroundbg-surface-success- Success component backgroundbg-surface-warning- Warning component background
Similar to colors, the Account Theme object passed to withAccountKitUi supports an overridable borderRadius field to customize the border radius size. The default value is sm which is an 8px border radius.
import { withAccountKitUi } from "@account-kit/react/tailwind";
export const tailwindConfig = withAccountKitUi(
{
content: [],
// your tailwind config
},
{
borderRadius: "md",
},
);The available options are:
none(0px)xs(4px)sm(8px)md(16px)lg(24px)
Unlike colors and border radius, illustration styles are not passed through the Tailwind plugin.
Customize the illustration style of various icons used in the components by passing one of the enum values to illustrationStyle in your uiConfig when you call createConfig.
import { createConfig } from "@account-kit/react";
import { sepolia, alchemy } from "@account-kit/infra";
const config = createConfig(
{
transport: alchemy({ apiKey: "YOUR_KEY" }),
chain: sepolia,
},
{
// ... other ui config options
illustrationStyle: "outline",
},
);To customize the header, you can override either of the header or hideSignInText options of the auth config when calling createConfig.
The auth modal, by default, shows a Sign in text header.
In this example, we hide the default header text and replace it with our own.
// @jsx: react-jsx
import { createConfig } from "@account-kit/react";
import { sepolia, alchemy } from "@account-kit/infra";
export const config = createConfig(
{
transport: alchemy({ apiKey: "YOUR_API_KEY" }),
chain: sepolia,
},
{
auth: {
header: "Sign in with your account", // [!code ++]
hideSignInText: true, // [!code ++]
},
},
);In this example, we leave the Sign in text in the modal and add an icon above it.
// @jsx: react-jsx
import { createConfig } from "@account-kit/react";
import { sepolia, alchemy } from "@account-kit/infra";
export const config = createConfig(
{
transport: alchemy({ apiKey: "YOUR_API_KEY" }),
chain: sepolia,
},
{
auth: {
header: <img src="img.src" />, // [!code ++]
},
},
);