npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dockcodes/accessibility-widget

v1.1.7

Published

Accessibility widget

Readme

@dockcodes/accessibility-widget

Check our Accessibility Widget.

Installation

npm install @dockcodes/accessibility-widget

or

yarn add @dockcodes/accessibility-widget

Usage

import accessibility from '@dockcodes/accessibility-widget';

await accessibility.init('YOUR_TOKEN');

accessibility.setContrast(true);
accessibility.setLanguage('en');
accessibility.setFontSize(4);
accessibility.onMenuOpen(() => {
    console.log('Menu opened!');
});
console.log(accessibility.isContrast); // true | false

Getters

We recommend loading values using their local storage keys, but you can also use AccessibilitySDK methods.

| Method | Local Storage Key | Description | | ------------------------ | ----------------------- | ------------------------------------------------------- | | isContrast | dacc-contrasted | Returns whether page contrast is enabled | | isInvert | dacc-inverted | Returns whether color inversion is enabled | | isUnderline | dacc-underline | Returns whether link underlining is enabled | | fontSizeScale | dacc-zoom | Returns the current font size (1–5) | | letterSpacingScale | dacc-letter-spacing | Returns the current letter spacing level (1–5) | | lineHeightScale | dacc-line-height | Returns the current line height (1–5) | | saturationScale | dacc-saturation | Returns the current color saturation level (1–3) | | isTextToSpeech | dacc-text-to-speech | Returns whether text-to-speech is enabled | | isCursorEnlarge | dacc-enlarge-cursor | Returns whether enlarged cursor is enabled | | isHideMedia | dacc-hide-media | Returns whether hiding embedded media is enabled | | isDisableAnimations | dacc-disable-animations | Returns whether page animations are disabled | | isReadingGuide | dacc-show-line | Returns whether reading guide is enabled | | isDyslexicFont | dacc-dyslexic | Returns whether dyslexic-friendly font is enabled | | isProfileMotorImpaired | dacc-mi | Returns whether motor impairment profile is enabled | | isProfileLowVision | dacc-lv | Returns whether low vision profile is enabled | | isProfileColorBlind | dacc-cb | Returns whether color blind profile is enabled | | isProfileDyslexia | dacc-ds | Returns whether dyslexia profile is enabled | | isProfileBlind | dacc-bl | Returns whether blind profile is enabled | | isProfileEpileptic | dacc-ep | Returns whether epilepsy-safe profile is enabled | | isProfileAdhd | dacc-ad | Returns whether ADHD profile is enabled | | isProfileCognitive | dacc-cal | Returns whether cognitive & learning profile is enabled |

Event triggers

| Method | Description | | ------------------------------------------- | --------------------------------------------- | | toggleContrast() | Toggles the page contrast | | setContrast(enabled: boolean) | Sets the page contrast on/off | | toggleInvertColors() | Toggles color inversion | | setInvertColors(enabled: boolean) | Sets color inversion on/off | | toggleUnderline() | Toggles link underlining | | setUnderline(enabled: boolean) | Enables/disables link underlining | | setFontSize(level: number) | Sets the font size (1–5) | | fontSizeLevelUp() | Iterates over font-size levels (1-4) | | increaseFontSize() | Increases font size by 1 | | decreaseFontSize() | Decreases font size by 1 | | increaseLetterSpacing() | Increases letter spacing | | setLetterSpacing(level: number) | Sets letter spacing level (1–5) | | letterSpacingLevelUp() | Iterates over letter spacing levels (1-4) | | increaseLineHeight() | Increases line height | | setLineHeight(level: number) | Sets line height (1–5) | | lineHeightLevelUp() | Iterates over line height levels (1-4) | | increaseSaturation() | Increases color saturation | | setSaturation(level: number) | Sets color saturation (1–3) | | saturationLevelUp() | Iterates over saturation levels (1-4) | | toggleTextToSpeech() | Toggles text-to-speech functionality | | setTextToSpeech(enabled: boolean) | Enables/disables text-to-speech | | toggleCursorEnlarge() | Toggles enlarged cursor | | setCursorEnlarge(enabled: boolean) | Enables/disables enlarged cursor | | toggleHideMedia() | Toggles hiding embedded media | | setHideMedia(enabled: boolean) | Enables/disables hiding media | | toggleDisableAnimations() | Toggles disabling page animations | | setDisableAnimations(enabled: boolean) | Enables/disables animation disabling | | toggleReadingGuide() | Toggles reading guide (line highlighting) | | setReadingGuide(enabled: boolean) | Enables/disables reading guide | | toggleDyslexicFont() | Toggles dyslexic-friendly font | | setDyslexicFont(enabled: boolean) | Enables/disables dyslexic font | | toggleProfileMotorImpaired() | Toggles motor impairment profile | | setProfileMotorImpaired(enabled: boolean) | Enables/disables motor impairment profile | | toggleProfileLowVision() | Toggles low vision profile | | setProfileLowVision(enabled: boolean) | Enables/disables low vision profile | | toggleProfileColorBlind() | Toggles color blind profile | | setProfileColorBlind(enabled: boolean) | Enables/disables color blind profile | | toggleProfileDyslexia() | Toggles dyslexia profile | | setProfileDyslexia(enabled: boolean) | Enables/disables dyslexia profile | | toggleProfileBlind() | Toggles blind profile | | setProfileBlind(enabled: boolean) | Enables/disables blind profile | | toggleProfileEpileptic() | Toggles epilepsy-safe profile | | setProfileEpileptic(enabled: boolean) | Enables/disables epilepsy-safe profile | | toggleProfileAdhd() | Toggles ADHD profile | | setProfileAdhd(enabled: boolean) | Enables/disables ADHD profile | | toggleProfileCognitive() | Toggles cognitive & learning profile | | setProfileCognitive(enabled: boolean) | Enables/disables cognitive & learning profile | | setLanguage(lang: string) | Sets the widget language | | openMenu() | Opens the accessibility menu | | closeMenu() | Closes the accessibility menu | | resetAll() | Resets all widget settings to default |

Event handlers

| Method | Event | | ----------------------------------------- | ---------------------------------- | | onMenuOpen(cb) | on open accessibility menu | | onMenuClose(cb) | on closed accessibility menu | | onChangeLanguage(cb) | on change widget language | | onChangePosition(cb) | on change widget position | | onChangeOption(cb) | on change any of widget option | | onChangeOptionContrast(cb) | on change contrast | | onChangeOptionFontSize(cb) | on change font size | | onChangeOptionInvertColor(cb) | on change invert colors option | | onChangeOptionUnderline(cb) | on change links decoration | | onChangeOptionDisableAnimations(cb) | on disable or enable animations | | onChangeOptionDyslexic(cb) | on enable or disable dyslexic font | | onChangeOptionEnlargeCursor(cb) | on change cursor size | | onChangeOptionHideMedia(cb) | on hide or show media | | onChangeOptionLetterSpacing(cb) | on change letter spacing | | onChangeOptionLineHeight(cb) | on change line height | | onChangeOptionSaturation(cb) | on change saturation | | onChangeOptionShowLine(cb) | on enable or disable reading guide | | onChangeOptionTextToSpeech(cb) | on enable or disable TTS | | onChangeProfile(cb) | on change any profile | | onChangeProfileAdhd(cb) | on change ADHD profile | | onChangeProfileBlind(cb) | on change Blind profile | | onChangeProfileCognitiveAndLearning(cb) | on change Cognitive profile | | onChangeProfileColorBlind(cb) | on change Color blind profile | | onChangeProfileDyslexia(cb) | on change Dyslexia profile | | onChangeProfileEpileptic(cb) | on change Epilepsy profile | | onChangeProfileLowVision(cb) | on change Low vision profile | | onChangeProfileMotorImpaired(cb) | on change Motor impaired profile |

Google Tag Manager integration

import accessibility from '@dockcodes/accessibility-widget';

await accessibility.init('YOUR_TOKEN');

accessibility.onChangeOption((data) => {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
        event: 'AccessibilityChange',
        optionType: data.type,
        optionValue: data.value,
    });
});

🔑 Get Your Free Widget Token

👉 https://wcag.dock.codes/my-account/tokens/