Theming
You can adapt CaptchaFox to your brand colors using the theme options.
This can be done through settings in the Admin Portal, by selecting a pre-built theme, or by providing your own.
Example:
Themes
The following base themes can be enabled by providing the data-theme attribute on the container element or the theme property using the JavaScript API.
Light (Default)
Dark
Portal Settings
The CaptchaFox Admin Portal allows users with the appropriate permissions to quickly and easily update colors and settings without the assistance of a developer.
The following theme settings can be adjusted via the Portal:
- Show/Hide CaptchaFox Logo (Only available within the Portal)
- Primary Color
- Error Color
- Success Color
- Border Radius
Custom Theme
A custom theme can be specified at the time of rendering to override all of the theme options. This allows you to fully customise the design to reflect your own brand.
As the custom theme has a higher priority, theme changes made through the Portal UI will no longer be applied.
captchafox.render(element, {
sitekey: 'YOUR_SITEKEY',
theme: {
// Theme Definition
},
});{
progressBar?: boolean;
general?: {
primary?: string;
primaryLight?: string;
error?: string;
errorLight?: string;
errorFill?: string;
success?: string;
successLight?: string;
successFill?: string;
borderRadius?: number;
};
button?: {
background?: string;
backgroundHover?: string;
text?: string;
checkbox?: string;
checkboxBorder?: string;
};
panel?: {
background?: string;
border?: string;
text?: string;
};
slider?: {
background?: string;
knob?: string;
};
}Labels (i18n)
You can change the texts the widget displays with the i18n option. Labels are set per language code and are shown whenever the widget is displayed in that language.
All labels are optional. Any label you don’t set keeps its default text.
captchafox.render(element, {
sitekey: 'YOUR_SITEKEY',
i18n: {
en: {
initial: 'Verify that you are human',
success: 'Verified',
},
de: {
initial: 'Bestätigen Sie, dass Sie ein Mensch sind',
success: 'Bestätigt',
},
},
});{
[languageCode]: {
initial?: string;
progress?: string;
success?: string;
error?: string;
retry?: string;
loading?: string;
fetchError?: string;
errorCode?: string;
troubleshoot?: string;
expired?: string;
refresh?: string;
ally?: {
initial?: string;
success?: string;
visual?: string;
audio?: string;
close?: string;
refresh?: string;
expired?: string;
troubleshoot?: string;
failed?: string;
};
};
}| Label | Description |
|---|---|
| initial | Shown before the verification starts. |
| progress | Shown while the verification is in progress. |
| success | Shown after a successful verification. |
| error | Shown when the verification failed. |
| retry | Button to retry the verification. |
| loading | Shown while the challenge is loading. |
| fetchError | Shown when the challenge could not be loaded. |
| errorCode | Shown for any other error. Use {code} to include the error code, e.g. 'Error: {code}'. |
| troubleshoot | Link to the troubleshooting help, shown when the verification was rejected. |
| expired | Shown when the verification expired. |
| refresh | Button to restart an expired verification. |
| ally | Texts read out by screen readers, see below. |
Screen reader labels
| Label | Description |
|---|---|
| initial | Read out before the verification starts. |
| success | Read out after a successful verification. |
| visual | Name of the visual challenge. |
| audio | Name of the audio challenge. |
| close | Name of the close button. |
| refresh | Name of the refresh button. |
| expired | Read out when the verification expired. |
| troubleshoot | Name of the troubleshooting link. |
| failed | Read out when the verification failed. |