Skip to content

Configuration Options Reference

Complete reference for all BrowseAid Widget configuration options.

Overview

The BrowseAid Widget accepts configuration through the global window.BrowseAidOptions object. All options are optional and have sensible defaults.

typescript
interface BrowseAidWidgetOptions {
  theme: 'v1' | 'v2'
  position: PositionOptions
  draggableToggle?: boolean
  sectionsCollapsible?: boolean
  sectionsCollapsed?: boolean
  tools?: ToolsConfiguration
  languages?: LanguagesConfiguration
  sections?: SectionsConfiguration
  profiles?: ProfilesConfiguration
}

Core Options

theme

Type: 'v1' | 'v2'Default: 'v2'

Selects the visual theme for the widget.

javascript
window.BrowseAidOptions = {
    theme: 'v2'  // Modern design with improved accessibility
};

Available themes:

  • 'v1' - Classic theme
  • 'v2' - Modern theme (recommended)

position

Type: PositionOptions

Controls the positioning of both the toggle button and widget panel.

typescript
interface PositionOptions {
  button: 'left-bottom' | 'right-bottom' | 'left-top' | 'right-top'
  widget: 'left' | 'right'
}

Defaults:

javascript
position: {
    button: 'right-bottom',
    widget: 'right'
}

Examples:

javascript
// Button in top-left, widget panel on left side
window.BrowseAidOptions = {
    position: {
        button: 'left-top',
        widget: 'left'
    }
};

draggableToggle

Type: booleanDefault: true

Enables or disables the draggable functionality for the widget button. When enabled, users can drag the button to a custom position on the screen.

javascript
window.BrowseAidOptions = {
    draggableToggle: true  // Allow the button to be draggable
};

sectionsCollapsible

Type: booleanDefault: true

Global setting that determines if widget sections can be collapsed/expanded.

javascript
window.BrowseAidOptions = {
    sectionsCollapsible: false  // All sections always expanded
};

sectionsCollapsed

Type: booleanDefault: false

Global setting for initial collapsed state of sections.

javascript
window.BrowseAidOptions = {
    sectionsCollapsed: true  // All sections start collapsed
};

Tools Configuration

tools

Type: Record<string, boolean>

Enable or disable specific accessibility tools globally.

javascript
window.BrowseAidOptions = {
    tools: {
        'font-size': true,           // Enable font size tool
        'text-to-speech': false,     // Disable text-to-speech
        'dark-mode': true,           // Enable dark mode
        'color-inversion': false,    // Disable color inversion
        'reading-guide': true        // Enable reading guide
    }
};

Available Tools:

Tool KeyDescription
font-sizeAdjust text size
line-spacingModify line height
text-alignChange text alignment
letter-spacingAdjust character spacing
word-spacingModify word spacing
readable-fontsApply dyslexia-friendly fonts
dark-modeToggle dark/light theme
contrastAdjust color contrast
color-filterApply colorblind filters
saturationModify color saturation
color-inversionInvert page colors
blue-filterReduce blue light
reading-guideShow reading line guide
reading-maskFocus reading area
text-to-speechRead text aloud
hide-imagesHide/show images
alt-text-tooltipShow image descriptions
sound-muteMute page sounds
link-highlighterHighlight links
heading-highlighterHighlight headings
focus-indicatorEnhanced focus outline
table-of-contentsPage structure navigation
reduced-motionReduce animations
big-cursorEnlarged cursor

Languages Configuration

languages

Type: string[] | Record<string, boolean>

Configure available interface languages.

Array Format:

javascript
window.BrowseAidOptions = {
    languages: ['en', 'es', 'fr', 'de', 'zh']
};

Object Format:

javascript
window.BrowseAidOptions = {
    languages: {
        'en': true,   // English (always available)
        'es': true,   // Spanish
        'fr': true,   // French
        'de': false,  // German (disabled)
        'zh': true    // Chinese
    }
};

Supported Language Codes:

CodeLanguageNative Name
enEnglishEnglish
esSpanishEspañol
frFrenchFrançais
deGermanDeutsch
zhChinese中文
bgBulgarianБългарски
csCzechČeština
daDanishDansk
elGreekΕλληνικά
etEstonianEesti
fiFinnishSuomi
hiHindiहिन्दी
hrCroatianHrvatski
huHungarianMagyar
itItalianItaliano
jaJapanese日本語
koKorean한국어
ltLithuanianLietuvių
lvLatvianLatviešu
nlDutchNederlands
noNorwegianNorsk
plPolishPolski
ptPortuguesePortuguês
roRomanianRomână
ruRussianРусский
skSlovakSlovenčina
slSlovenianSlovenščina
svSwedishSvenska
trTurkishTürkçe

Note: English (en) is always available as a fallback language.

Sections Configuration

sections

Type: Record<string, SectionConfiguration>

Configure individual widget sections.

typescript
interface SectionConfiguration {
  enabled: boolean
  title?: string
  titleLocalized?: Record<string, string>
  collapsible?: boolean
  collapsed?: boolean
  tools?: Record<string, boolean>
}

Available Sections:

  • profiles - Accessibility Profiles
  • language - Language Settings
  • text - Text Settings
  • color - Color Settings
  • reading - Reading Tools
  • media - Media Settings
  • navigation - Navigation Helpers

Example:

javascript
window.BrowseAidOptions = {
    sections: {
        text: {
            enabled: true,
            title: 'Typography Options',
            titleLocalized: {
                'es': 'Opciones de Tipografía',
                'fr': 'Options de Typographie'
            },
            collapsible: false,  // Override global setting
            collapsed: true,     // Start collapsed
            tools: {
                'font-size': true,
                'line-spacing': true,
                'readable-fonts': false
            }
        },
        color: {
            enabled: true,
            tools: {
                'dark-mode': true,
                'color-inversion': false
            }
        },
        media: {
            enabled: false  // Disable entire section
        }
    }
};

Profiles Configuration

profiles

Type: Record<string, ProfileConfiguration>

Create, modify, or disable accessibility profiles.

typescript
interface ProfileConfiguration {
  enabled?: boolean
  title?: string
  titleLocalized?: Record<string, string>
  description?: string
  descriptionLocalized?: Record<string, string>
  tools?: Record<string, ToolSettings>
}

interface ToolSettings {
  enabled: boolean
  [option: string]: any  // Tool-specific options
}

Default Profiles:

  • seizureSafe - Eliminates flashes and reduces color
  • visionImpaired - Enhances visuals for better readability
  • adhdFriendly - Reduces distractions and improves focus
  • cognitiveDisability - Assists with reading and focusing
  • keyboardNavigation - Optimizes for keyboard-only use
  • blindUser - Optimizes for screen readers

Examples:

Override Existing Profile:

javascript
window.BrowseAidOptions = {
    profiles: {
        seizureSafe: {
            title: 'Enhanced Seizure Safety',
            description: 'Maximum protection against seizure triggers',
            tools: {
                'reduced-motion': { enabled: true },
                'hide-images': { enabled: true, showAltText: true },
                saturation: { enabled: true, level: 50 }  // Lower saturation
            }
        }
    }
};

Create Custom Profile:

javascript
window.BrowseAidOptions = {
    profiles: {
        myCustomProfile: {
            title: 'High Contrast Reading',
            titleLocalized: {
                'es': 'Lectura de Alto Contraste',
                'fr': 'Lecture à Contraste Élevé'
            },
            description: 'Optimized for users with low vision',
            descriptionLocalized: {
                'es': 'Optimizado para usuarios con baja visión',
                'fr': 'Optimisé pour les utilisateurs malvoyants'
            },
            tools: {
                'font-size': { enabled: true, level: 1.8 },
                'contrast': { enabled: true, level: 'enhanced' },
                'line-spacing': { enabled: true, level: '2.0' },
                'dark-mode': { enabled: true }
            }
        }
    }
};

Disable Profile:

javascript
window.BrowseAidOptions = {
    profiles: {
        adhdFriendly: {
            enabled: false  // Remove from interface
        }
    }
};

Tool-Specific Settings

When configuring tools in profiles, you can include tool-specific options:

Font Size

javascript
'font-size': {
    enabled: true,
    level: 1.5  // 150% of original size
}

Text to Speech

javascript
'text-to-speech': {
    enabled: true,
    speechRate: 1.2,     // Speaking speed
    speechPitch: 1.0,    // Voice pitch
    highlightMode: 'word' // 'word' | 'sentence' | 'paragraph'
}

Color Saturation

javascript
saturation: {
    enabled: true,
    level: 80  // 80% saturation
}

Reading Guide

javascript
'reading-guide': {
    enabled: true,
    thickness: 3,    // Line thickness
    color: '#ff0000' // Custom color
}

Complete Example

javascript
window.BrowseAidOptions = {
    // Core settings
    theme: 'v2',
    position: {
        button: 'right-bottom',
        widget: 'right'
    },

    // Section behavior
    sectionsCollapsible: true,
    sectionsCollapsed: false,

    // Available languages
    languages: ['en', 'es', 'fr', 'de'],

    // Global tool settings
    tools: {
        'text-to-speech': false,  // Disable globally
        'color-inversion': false
    },

    // Section configuration
    sections: {
        text: {
            enabled: true,
            title: 'Typography',
            collapsible: true,
            collapsed: false,
            tools: {
                'font-size': true,
                'line-spacing': true,
                'readable-fonts': true
            }
        },
        profiles: {
            enabled: true,
            collapsible: false  // Always expanded
        }
    },

    // Custom profiles
    profiles: {
        // Override existing profile
        visionImpaired: {
            title: 'Low Vision Support',
            tools: {
                'font-size': { enabled: true, level: 2.0 },
                'contrast': { enabled: true, level: 'enhanced' },
                'big-cursor': { enabled: true, level: 'white' }
            }
        },

        // Custom profile
        officeWorker: {
            title: 'Office Environment',
            description: 'Optimized for long computer sessions',
            tools: {
                'blue-filter': { enabled: true, level: 'medium' },
                'dark-mode': { enabled: true },
                'reduced-motion': { enabled: true }
            }
        }
    }
};

Validation and Fallbacks

The widget automatically handles invalid configurations:

  • Invalid themes → Falls back to 'v2'
  • Unknown language codes → Filtered out with console warnings
  • Missing English → Always added as fallback
  • Invalid positions → Uses defaults
  • Unknown tools → Ignored silently
  • Malformed sections → Uses defaults

Next Steps

BrowseAid Documentation