{"id":21156067,"url":"https://github.com/seanwuapps/sr-speak","last_synced_at":"2026-01-27T15:03:10.808Z","repository":{"id":263675451,"uuid":"871529897","full_name":"seanwuapps/sr-speak","owner":"seanwuapps","description":"sr-speak provides utilities that utilises ARIA live regions to help screen reader users hear updates happened on the page.","archived":false,"fork":false,"pushed_at":"2024-10-13T11:16:13.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-13T10:42:19.048Z","etag":null,"topics":["a11y","announcement","aria","live-regions","screen-reader"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seanwuapps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-12T08:06:23.000Z","updated_at":"2024-10-13T11:20:09.000Z","dependencies_parsed_at":"2024-11-19T20:51:26.965Z","dependency_job_id":"010a3fdb-5d2d-4138-a057-53a17a8cda34","html_url":"https://github.com/seanwuapps/sr-speak","commit_stats":null,"previous_names":["seanwuapps/sr-speak"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/seanwuapps/sr-speak","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanwuapps%2Fsr-speak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanwuapps%2Fsr-speak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanwuapps%2Fsr-speak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanwuapps%2Fsr-speak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seanwuapps","download_url":"https://codeload.github.com/seanwuapps/sr-speak/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanwuapps%2Fsr-speak/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28815385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a11y","announcement","aria","live-regions","screen-reader"],"created_at":"2024-11-20T11:35:31.221Z","updated_at":"2026-01-27T15:03:10.793Z","avatar_url":"https://github.com/seanwuapps.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📢 SR Speak\n\n`sr-speak` provides utilities that utilises ARIA live regions to help screen reader users hear updates happened on the page.\n\n## Install\n\n```bash\nnpm install sr-speak\n```\n\n## Setup \"speaker\"\n\nAria live regions need to be inside the DOM for Screen Readers to accurately monitor changes to its content.\n\n```js\nimport { setupSpeaker } from \"sr-speak\";\n\n// call setupSpeak on page load\nsetupSpeaker();\n```\n\nYou only need to do this once per page load, in the case of a SPA app, call this once in your app initialisation.\n\n## Speak\n\n```js\nimport { speak } from \"sr-speak\";\n\n// ...\n// (e.g. when user clicks Search button)\nspeak(\"Searching...\"); // default politeness is 'polite'\n\n// (e.g. error occurred)\nspeak(\"You shall not pass\", \"assertive\");\n```\n\n## Under the hood and Politeness\n\nWhen `setupSpeaker` is called, 2 visually hidden elements are created and appended to the body element. These 2 elements are the live regions, one for `polite` messages and the other one for `assertive` messages.\n\nby default, when you call the `speak` function, the `aria-live=\"polite\"` content is updated, you can choose to update the `aria-live=\"assertive\"` live region by specifying the politeness in the second parameter. e.g. `speak('Important message', 'assertive')`\n\n[Read more about live regions in MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#live_regions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanwuapps%2Fsr-speak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseanwuapps%2Fsr-speak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanwuapps%2Fsr-speak/lists"}