• Stars
    star
    128
  • Rank 280,395 (Top 6 %)
  • Language
    JavaScript
  • License
    The Unlicense
  • Created over 7 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

On Demand Live Regions

A tiny module for making screen readers announce text on demand, without a visual change to the interface. Initializing and using the live region is as simple as:

const liveRegion = new OnDemandLiveRegion()

liveRegion.say('Hello World!')

Installation

Just grab the minified version or install from NPM:

npm i on-demand-live-region

Settings object

  • level — the live region level (default: polite)
  • parent — the element to which the live region will be appended (default: body)
  • idPrefix — the prefix for the unique id generated for the live region (default: live-region-)
  • delay — the delay in milliseconds before the phrase is announced (default: 0)

Assertive example with a half second delay

const liveRegionDelayed = new OnDemandLiveRegion({
  level: 'assertive',
  delay: 500
})

liveRegionDelayed.say('Hello World! (sorry, delayed reaction)')

You can override the delay setting in a second argument when calling say:

liveRegionDelayed.say('Hello World! (sorry, delayed reaction)', 1000)

Say it over and over

Each time you use the say method, the extant live region (if it exists) is destroyed and a new one created. This means you can reliably make the same announcement multiple times. This is not guaranteed in other implementations, where a persistent live region is repopulated.

Tested in

  • Safari with VoiceOver
  • Chrome with VoiceOver
  • IE11 with JAWS
  • Chrome with JAWS
  • Firefox with NVDA
  • Chrome with ChromeVox

More Repositories

1

inclusive-design-checklist

Aims to be the biggest checklist of inclusive design considerations ever
JavaScript
2,713
star
2

fukol-grids

CSS
1,468
star
3

REVENGE.CSS

A CSS bookmarklet that puts pink error boxes (with messages in comic sans) everywhere you write bad HTML.
CSS
828
star
4

forceFeed

JavaScript
518
star
5

bruck

A prototyping system built with web components and the Houdini Paint API
JavaScript
511
star
6

watched-box

JavaScript
327
star
7

Community-Icon-Font

To create a collaborative font using SVG
196
star
8

inclusive-menu-button

A keyboard and screen reader accessible ARIA menu button implementation.
JavaScript
191
star
9

design-tokens-cli

Set of design tokens and a custom properties parser for prototyping
JavaScript
173
star
10

cel-animation

A Sass @mixin for creating traditional frame-based animations, especially with SVG
CSS
155
star
11

beadz-drum-machine

A quantum, polymetric drum machine.
Vue
141
star
12

ga11ery

Eleventy theme for showcasing photography and web comics
HTML
97
star
13

cress

JavaScript
83
star
14

readabilityCheckerCLI

A node CLI for checking how readable content is. Accepts a URL or HTML file.
JavaScript
70
star
15

xiao

A tiny, accessible, browser-driven single-page routing system.
JavaScript
56
star
16

react-sortable-table-demo

See the article here: https://inclusive-components.design/data-tables
JavaScript
40
star
17

css-scopulation-enterprise-max-ai

JavaScript
29
star
18

react-theme-switch

JavaScript
27
star
19

Inclusive-Components

Resources for the inclusive components blog (inclusive-components.design)
26
star
20

css-error-property-style

18
star
21

wai-aria-web-component

A "disclosure" (show/hide) web component using ARIA and built with Polymer
CSS
13
star
22

inclusive-inline-editable

JavaScript
9
star
23

buttonlike

A jQuery plugin for making clickable elements more accessible
JavaScript
8
star
24

typical-theme-wordpress

A responsive, resolution independent Wordpress theme with microdata support
CSS
8
star
25

AMA

Ask me anything
6
star
26

Squib-Font

A free font licensed under the Open Font License
6
star
27

heydonworks

HeydonWorks Wordpress theme
CSS
3
star
28

Accessible-Designer-Examples

Examples of creative, accessible design concepts.
HTML
3
star
29

ga11ery-michael

HTML
2
star
30

ga11ery-example

HTML
2
star
31

niace-stories-app

The alpha application for NIACE.
JavaScript
1
star
32

Redfoir

Freedom of Information Timeline Project
JavaScript
1
star