Skip to Content

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:

Custom Theme

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)

Light Theme

Dark

Dark Theme

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 }, });
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', }, }, });
i18n Definition
{ [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; }; }; }
LabelDescription
initialShown before the verification starts.
progressShown while the verification is in progress.
successShown after a successful verification.
errorShown when the verification failed.
retryButton to retry the verification.
loadingShown while the challenge is loading.
fetchErrorShown when the challenge could not be loaded.
errorCodeShown for any other error. Use {code} to include the error code, e.g. 'Error: {code}'.
troubleshootLink to the troubleshooting help, shown when the verification was rejected.
expiredShown when the verification expired.
refreshButton to restart an expired verification.
allyTexts read out by screen readers, see below.

Screen reader labels

LabelDescription
initialRead out before the verification starts.
successRead out after a successful verification.
visualName of the visual challenge.
audioName of the audio challenge.
closeName of the close button.
refreshName of the refresh button.
expiredRead out when the verification expired.
troubleshootName of the troubleshooting link.
failedRead out when the verification failed.
Last updated on