Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.inploi.com/llms.txt

Use this file to discover all available pages before exploring further.

Accessibility Plugin

The Accessibility plugin adds an overlay with tools to help users customize their viewing experience.

Installation

npm install @inploi/plugin-accessibility

Basic usage

import { initialiseSdk } from '@inploi/sdk';
import { accessibilityPlugin } from '@inploi/plugin-accessibility';

const sdk = initialiseSdk({ publishableKey: 'pk_...', env: 'sandbox' });
const accessibility = sdk.register(accessibilityPlugin({
  widget: {
    colors: { interface: '#222222', trigger: '#5fbb46' },
  },
}));

accessibility.initialiseWidget();

Features

The accessibility overlay includes:
  • Font size adjustment — Increase or decrease text size
  • Contrast modes — High contrast and dark mode options
  • Reading aids — Line focus, reading guide
  • Motion controls — Reduce animations

Configuration

Colors

Colors are required. They control the widget’s interface and trigger button appearance.
type Colors = {
  interface: string; // Main UI color (hex)
  trigger: string;   // Floating button color (hex)
};
OptionTypeDescription
interfacestringHex color for the overlay interface elements
triggerstringHex color for the floating trigger button

Language

Set the widget language. Defaults to 'en'.
const accessibility = sdk.register(accessibilityPlugin({
  widget: {
    colors: { interface: '#222222', trigger: '#5fbb46' },
    language: 'fr',
  },
}));
Supported languages:
CodeLanguageCodeLanguage
enEnglishnlDutch
esSpanishhuHungarian
frFrenchslSlovenian
deGermanskSlovak
plPolishcsCzech
itItaliantrTurkish
ptPortuguesejaJapanese
heHebrewzhChinese
ruRussiantwTaiwanese
arArabic

Position

Control the trigger button placement on desktop and mobile independently.
const accessibility = sdk.register(accessibilityPlugin({
  widget: {
    colors: { interface: '#222222', trigger: '#5fbb46' },
    position: {
      x: { desktop: 'left', mobile: 'right' },
      y: { desktop: 'bottom', mobile: 'bottom' },
      offsetX: { desktop: 20, mobile: 10 },
      offsetY: { desktop: 20, mobile: 10 },
    },
  },
}));
OptionTypeDefaultDescription
x{ desktop: 'left' | 'right', mobile: 'left' | 'right' }'right'Horizontal position
y{ desktop: 'top' | 'center' | 'bottom', mobile: 'top' | 'center' | 'bottom' }'bottom'Vertical position
offsetX{ desktop: number, mobile: number }desktop: none, mobile: 4Horizontal offset in pixels
offsetY{ desktop: number, mobile: number }desktop: none, mobile: 4Vertical offset in pixels

Trigger visibility

Hide the floating trigger button if you want to open the widget programmatically or through your own UI.
const accessibility = sdk.register(accessibilityPlugin({
  widget: {
    colors: { interface: '#222222', trigger: '#5fbb46' },
    showTrigger: false,
  },
}));

API

initialiseWidget()

Injects the accessibility overlay into the page. Safe to call multiple times — subsequent calls are no-ops if the widget is already loaded.
accessibility.initialiseWidget();

Full configuration reference

type AccessibilityWidgetConfig = {
  colors: {
    interface: string;
    trigger: string;
  };
  language?: 'en' | 'es' | 'fr' | 'de' | 'pl' | 'it' | 'pt'
    | 'nl' | 'hu' | 'sl' | 'sk' | 'cs' | 'tr'
    | 'ja' | 'tw' | 'zh' | 'he' | 'ru' | 'ar';
  showTrigger?: boolean;
  position?: {
    x?: { mobile: 'left' | 'right'; desktop: 'left' | 'right' };
    y?: { mobile: 'top' | 'center' | 'bottom'; desktop: 'top' | 'center' | 'bottom' };
    offsetX?: { mobile: number; desktop: number };
    offsetY?: { mobile: number; desktop: number };
  };
};