@rafcin/live-region

Aria live region for React components

Usage no npm install needed!

<script type="module">
  import rafcinLiveRegion from 'https://cdn.skypack.dev/@rafcin/live-region';
</script>

README

Live Regions

ARIA Live Regions are used to communicate important information to screen reader software.

Installation

yarn add @rafcin/live-region

Import components

import { LiveRegion, useLiveRegion } from "@rafcin/live-region"

Usage

import { useLiveRegion } from "@rafcin/live-region"

function Example() {
  const region = useLiveRegion()
  return (
    <button
      onClick={() => {
        region.speak("Filtering categories was successful")
      }}
    >
      Click me
    </button>
  )
}