JavaScript configuration reference

Complete reference for every property in the window._cyA11yConfig object. Covers position, language, appearance, modules, features, and the keyboard shortcut.

Updated

In this article: Every property available in window._cyA11yConfig, its type, accepted values, and default.

The widget reads configuration from the global window._cyA11yConfig object before it initialises. Set this object before the widget script tag loads. Any property you omit falls back to its default value.


Full configuration object

window._cyA11yConfig = {

  // ── Appearance ────────────────────────────────────────
  iconId:      'default',   // Widget button icon shape
  color:       '#1863DC',   // Widget button background colour (hex)
  size:        48,          // Widget button diameter in pixels
  buttonLabel: 'Accessibility widget', // Accessible name (screen readers)

  // ── Position ──────────────────────────────────────────
  position: {
    desktop: 'bottom-right', // 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
    mobile:  'bottom-right',
  },

  // ── Offset ────────────────────────────────────────────
  offset: {
    desktop: { horizontal: 20, vertical: 20 }, // pixels from screen edge
    mobile:  { horizontal: 20, vertical: 20 },
  },

  // ── Language ──────────────────────────────────────────
  language: {
    default:  'en',  // ISO 639-1 code — widget always loads in this language
    selected: [],    // Languages available in the visitor's language switcher
  },

  // ── Keyboard shortcut ─────────────────────────────────
  keyboard: {
    enabled: false,  // true to register the shortcut
    key:     'a',    // Letter key — pressed with Alt (Windows/Linux) or Option (Mac)
  },

  // ── Modules ───────────────────────────────────────────
  modules: {
    statement: {
      enabled: false,  // Show an accessibility statement link in the widget
      url:     '',     // Full URL of your accessibility statement page
    },
  },

  // ── Features ──────────────────────────────────────────
  // Set any feature to false to hide it from the widget panel.
  // All features are enabled by default.
  features: {
    // Profiles
    seizureSafeProfile:    true,
    lowVisionProfile:      true,
    adhdProfile:           true,
    cognitiveProfile:      true,

    // Content adjustments
    fontSize:              true,
    readableFont:          true,
    highlightTitles:       true,
    highlightLinks:        true,
    letterSpacing:         true,
    lineHeight:            true,
    fontWeight:            true,
    alignLeft:             true,

    // Colour and contrast
    darkContrast:          true,
    lightContrast:         true,
    highContrast:          true,
    highSaturation:        true,
    lowSaturation:         true,
    monochrome:            true,

    // Navigation tools
    readingGuide:          true,
    pauseAnimations:       true,
    bigCursor:             true,
  },

};

Property reference

iconId

The icon displayed inside the widget button.

ValueDescription
'default'Standard accessibility person icon (default)
'icon-2'Alternate style 2
'icon-3'Alternate style 3
'icon-4'Alternate style 4

color

The background colour of the floating widget button. Accepts any valid CSS hex colour value.

PropertyTypeDefault
colorstring (hex)'#1863DC'

The button icon is white. Choose a colour with at least 3:1 contrast ratio against white to meet WCAG 2.1 AA for UI components. You can check contrast ratios at webaim.org/resources/contrastchecker.


size

The diameter of the floating button in pixels.

PropertyTypeDefaultMinimum recommended
sizenumber4844

WCAG 2.5.8 (Target Size, AA) recommends a minimum touch target of 24×24 px. WCAG 2.5.5 (Target Size, AAA) recommends 44×44 px. The default 48px exceeds both thresholds. Only reduce the size if space is genuinely constrained.


buttonLabel

The accessible name of the widget button, announced by screen readers when a visitor focuses the button. This text is not visible on screen.

PropertyTypeDefault
buttonLabelstring'Accessibility widget'

Change this if your site is in a language other than English and you are not using the language feature. For example, set 'Widget d'accessibilité' for a French-language site.


position

Controls where the floating button appears on the screen. Desktop and mobile are set independently.

position: {
  desktop: 'bottom-right',
  mobile:  'bottom-right',
}
ValueDescription
'bottom-right'Bottom-right corner (default)
'bottom-left'Bottom-left corner
'top-right'Top-right corner
'top-left'Top-left corner

Set a different position for desktop and mobile if your layout has fixed elements (such as a chat launcher or cookie banner) occupying one corner on only one device type.


offset

The distance in pixels from the button to the nearest screen edges. Configured separately for desktop and mobile.

offset: {
  desktop: { horizontal: 20, vertical: 20 },
  mobile:  { horizontal: 20, vertical: 20 },
}
PropertyTypeDefault
offset.desktop.horizontalnumber20
offset.desktop.verticalnumber20
offset.mobile.horizontalnumber20
offset.mobile.verticalnumber20

Increase the offset if the widget overlaps a sticky footer, cookie banner, or other fixed element. Values between 16 and 40 are typical for most layouts.


language

Controls the language the widget displays in and which languages visitors can switch to.

language: {
  default:  'en',
  selected: ['en', 'fr', 'de'],
}
PropertyTypeDefaultDescription
language.defaultstring (ISO 639-1)'en'The language the widget loads in
language.selectedstring[][]Languages offered in the visitor’s language switcher. An empty array hides the switcher.

When selected contains more than one language code, a language dropdown appears at the top of the widget panel. Visitors can switch language and their choice is saved to localStorage.

Supported language codes (selection):

CodeLanguageCodeLanguage
arArabicitItalian
zhChinese (Simplified)jaJapanese
zh-TWChinese (Traditional)koKorean
hrCroatiannlDutch
csCzechplPolish
daDanishptPortuguese
nlDutchpt-BRPortuguese (Brazil)
enEnglishroRomanian
fiFinnishruRussian
frFrenchskSlovak
deGermanesSpanish
elGreeksvSwedish
heHebrewtrTurkish
hiHindiukUkrainian
huHungarianviVietnamese

AccessYes supports 50+ languages in total. Contact accessyes@cookieyes.com if your language is not listed.


keyboard

Registers a keyboard shortcut that opens the widget without clicking the button.

keyboard: {
  enabled: true,
  key: 'a',
}
PropertyTypeDefaultDescription
keyboard.enabledbooleanfalseWhether the shortcut is active
keyboard.keystring'a'The letter key, pressed with Alt (Windows/Linux) or Option (Mac)

The default shortcut Alt + A / Option + A is the most common choice. Choose a key that does not conflict with browser or operating system shortcuts on your target platforms.

Accessibility note

A keyboard shortcut makes the widget discoverable for keyboard users without requiring them to tab to the button. It is especially useful on long pages where the widget button may be far from the current focus position.


modules.statement

Controls the accessibility statement link shown inside the widget panel.

modules: {
  statement: {
    enabled: true,
    url: 'https://example.com/accessibility-statement/',
  },
}
PropertyTypeDefaultDescription
modules.statement.enabledbooleanfalseShow the statement link in the widget
modules.statement.urlstring''Full URL of your accessibility statement

When enabled is true and a url is provided, a link appears in the widget footer. If url is empty, the link does not appear even if enabled is true.

An accessibility statement is required for public sector websites in the UK and EU and is considered best practice for any organisation publicly demonstrating accessibility compliance.


features

Controls which tools are visible in the widget panel. Set any feature to false to hide it from all visitors. All features are true by default.

features: {
  fontSize:    true,   // show the feature
  darkContrast: false, // hide the feature
}
Important

Hiding a feature prevents all visitors from using it, including those who rely on it. Only disable a feature if it causes a genuine technical conflict with your site. Hiding features because they alter your visual design is not recommended.

Profiles

KeyDefaultWhat it does
seizureSafeProfiletrueReduces flashing colours and motion
lowVisionProfiletrueIncreases font size, contrast, and cursor size
adhdProfiletrueReduces distractions and focuses reading area
cognitiveProfiletrueSimplifies layout and improves readability

Content adjustments

KeyDefaultWhat it does
fontSizetrueLets visitors increase or decrease text size
readableFonttrueSwitches to a dyslexia-friendly typeface
highlightTitlestrueAdds visual emphasis to headings
highlightLinkstrueUnderlines and highlights all links
letterSpacingtrueIncreases spacing between characters
lineHeighttrueIncreases spacing between lines
fontWeighttrueIncreases font weight for improved legibility
alignLefttrueOverrides justified or centred text to left-align

Colour and contrast

KeyDefaultWhat it does
darkContrasttrueDark background, light text
lightContrasttrueLight background, dark text
highContrasttrueMaximum contrast between text and background
highSaturationtrueIncreases colour intensity
lowSaturationtrueReduces colour intensity
monochrometrueStrips all colour from the page
KeyDefaultWhat it does
readingGuidetrueOverlays a horizontal line that follows the cursor
pauseAnimationstrueStops CSS animations and transitions
bigCursortrueReplaces the default cursor with a larger one

Minimal embed example

Only position and language configured — everything else uses defaults:

<script>
(function(w,d,s,u){
  w._cyA11yConfig = {
    position: { desktop: 'bottom-left', mobile: 'bottom-left' },
    language: { default: 'fr', selected: [] },
    modules:  { statement: { enabled: false, url: '' } }
  };
  var js = d.createElement(s), fjs = d.getElementsByTagName(s)[0];
  js.src = u;
  js.async = true;
  fjs.parentNode.insertBefore(js, fjs);
})(window, document, 'script',
   'https://cdn-cookieyes.com/widgets/accessibility.js?id=YOUR_WIDGET_ID');
</script>

Full configuration example

<script>
(function(w,d,s,u){
  w._cyA11yConfig = {
    iconId:      'default',
    color:       '#0F4C9A',
    size:        48,
    buttonLabel: 'Accessibility widget',
    position: {
      desktop: 'bottom-right',
      mobile:  'bottom-left',
    },
    offset: {
      desktop: { horizontal: 24, vertical: 24 },
      mobile:  { horizontal: 16, vertical: 80 },
    },
    language: {
      default:  'en',
      selected: ['en', 'fr', 'de', 'es'],
    },
    keyboard: {
      enabled: true,
      key:     'a',
    },
    modules: {
      statement: {
        enabled: true,
        url:     'https://example.com/accessibility-statement/',
      },
    },
    features: {
      seizureSafeProfile:    true,
      lowVisionProfile:      true,
      adhdProfile:           true,
      cognitiveProfile:      true,
      fontSize:              true,
      readableFont:          true,
      highlightTitles:       true,
      highlightLinks:        true,
      letterSpacing:         true,
      lineHeight:            true,
      fontWeight:            true,
      alignLeft:             true,
      darkContrast:          true,
      lightContrast:         true,
      highContrast:          true,
      highSaturation:        true,
      lowSaturation:         true,
      monochrome:            true,
      readingGuide:          true,
      pauseAnimations:       true,
      bigCursor:             true,
    },
  };
  var js = d.createElement(s), fjs = d.getElementsByTagName(s)[0];
  js.src = u;
  js.async = true;
  fjs.parentNode.insertBefore(js, fjs);
})(window, document, 'script',
   'https://cdn-cookieyes.com/widgets/accessibility.js?id=YOUR_WIDGET_ID');
</script>