Gathering detailed insights and metrics for aria-query
Gathering detailed insights and metrics for aria-query
Gathering detailed insights and metrics for aria-query
Gathering detailed insights and metrics for aria-query
@types/aria-query
TypeScript definitions for aria-query
html-aria
Utilities for creating accessible HTML based on the latest ARIA 1.3 specs. Lightweight, performant, tree-shakeable, and 0 dependencies.
fire-query-aria
Easy react hooks for firebase mutations and query
@konnorr/aria-query
Programmatic access to the ARIA specification
Programmatic access to the ARIA specification
npm install aria-query
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.6
Supply Chain
100
Quality
83.2
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
5,258,397,677
Last Day
1,952,615
Last Week
39,001,296
Last Month
167,004,586
Last Year
1,685,005,907
Apache-2.0 License
295 Stars
384 Commits
43 Forks
12 Watchers
5 Branches
25 Contributors
Updated on May 30, 2025
Minified
Minified + Gzipped
Latest Version
5.3.2
Package Id
aria-query@5.3.2
Unpacked Size
171.99 kB
Size
25.09 kB
File Count
157
NPM Version
10.8.3
Node Version
22.9.0
Published on
Sep 20, 2024
Cumulative downloads
Total Downloads
Last Day
-10.3%
1,952,615
Compared to previous day
Last Week
-7.6%
39,001,296
Compared to previous week
Last Month
0.2%
167,004,586
Compared to previous month
Last Year
36%
1,685,005,907
Compared to previous year
22
Programmatic access to the WAI-ARIA 1.2 Roles Model. This package tracks the W3C Recommendation (last update: 6 June 2023).
CDN URL: https://unpkg.com/aria-query
src/etc
filesThe files under src/etc
are generated by the breakUpAriaJSON
script.
To change them, edit the file scripts/roles.json
then run:
1node ./scripts/breakUpAriaJSON.js 2git add scripts/roles.json src/etc
It should work with Node version 6.11.2 or later.
These methods are available on each export from the module. The typing here in the documentation is pseudo-typed. Each export will have its own specific types for each method signature.
1{| 2 entries: () => Array<$Item>, 3 get: (key: $Key) => ?$Value, 4 has: (key: $Key) => boolean, 5 keys: () => Array<$Key>, 6 values: () => Array<$Value>, 7|};
1import { roles } from 'aria-query';
A map of role names to the role definition. For example:
1let alertRole = roles.get('alert'); 2/** 3 * Value of alertRole 4 * { 5 * "requiredProps": {}, 6 * "props": { 7 * "aria-atomic": "true", 8 * "aria-busy": null, 9 * "aria-controls": null, 10 * "aria-current": null, 11 * "aria-describedby": null, 12 * "aria-details": null, 13 * "aria-disabled": null, 14 * "aria-dropeffect": null, 15 * "aria-errormessage": null, 16 * "aria-expanded": null, 17 * "aria-flowto": null, 18 * "aria-grabbed": null, 19 * "aria-haspopup": null, 20 * "aria-hidden": null, 21 * "aria-invalid": null, 22 * "aria-keyshortcuts": null, 23 * "aria-label": null, 24 * "aria-labelledby": null, 25 * "aria-live": "assertive", 26 * "aria-owns": null, 27 * "aria-relevant": null, 28 * "aria-roledescription": null 29 * }, 30 * "abstract": false, 31 * "childrenPresentational": false, 32 * "baseConcepts": [], 33 * "relatedConcepts": [ { 34 * "module": "XForms", 35 * "concept": { 36 * "name": "alert" 37 * } 38 * }], 39 * "superClass": [["roletype", "structure", "section"]] 40 * }
1import { elementRoles } from 'aria-query';
HTML Elements with inherent roles are mapped to those roles. In the case of an element like <input>
, the element often requires a type
attribute to map to an ARIA role.
1[ 2 [ '{"name": "article"}', [ 'article' ] ], 3 [ '{"name": "button"}', [ 'button' ] ], 4 [ '{"name": "td"}', [ 'cell', 'gridcell' ] ], 5 [ '{"name": "input", "attributes": [ {"name": "type", "value": "checkbox"}] }', [ 'checkbox' ] ], 6 [ '{"name": "th"}', [ 'columnheader' ] ], 7 [ '{"name": "select"}', [ 'combobox', 'listbox' ] ], 8 [ '{"name": "menuitem"}', [ 'command', 'menuitem' ] ], 9 [ '{"name": "dd"}', [ 'definition' ] ], 10 [ '{"name": "figure"}', [ 'figure' ] ], 11 [ '{"name": "form"}', [ 'form' ] ], 12 [ '{"name": "table"}', [ 'grid', 'table' ] ], 13 [ '{"name": "fieldset"}', [ 'group' ] ], 14 [ '{"name": "h1"}', [ 'heading' ] ], 15 [ '{"name": "h2"}', [ 'heading' ] ], 16 [ '{"name": "h3"}', [ 'heading' ] ], 17 [ '{"name": "h4"}', [ 'heading' ] ], 18 [ '{"name": "h5"}', [ 'heading' ] ], 19 [ '{"name": "h6"}', [ 'heading' ] ], 20 [ '{"name": "img"}', [ 'img' ] ], 21 [ '{"name": "a"}', [ 'link' ] ], 22 [ '{"name": "link"}', [ 'link' ] ], 23 [ '{"name": "ol"}', [ 'list' ] ], 24 [ '{"name": "ul"}', [ 'list' ] ], 25 [ '{"name": "li"}', [ 'listitem' ] ], 26 [ '{"name": "nav"}', [ 'navigation' ] ], 27 [ '{"name": "option"}', [ 'option' ] ], 28 [ '{"name": "input", "attributes": [ {"name": "type", "value": "radio"}] }', [ 'radio' ] ], 29 [ '{"name": "frame"}', [ 'region' ] ], 30 [ '{"name": "rel"}', [ 'roletype' ] ], 31 [ '{"name": "tr"}', [ 'row' ] ], 32 [ '{"name": "tbody"}', [ 'rowgroup' ] ], 33 [ '{"name": "tfoot"}', [ 'rowgroup' ] ], 34 [ '{"name": "thead"}', [ 'rowgroup' ] ], 35 [ '{"name": "th", "attributes": [ {"name": "scope", "value": "row"}] }', [ 'rowheader' ] ], 36 [ '{"name": "input", "attributes": [ {"name": "type", "value": "search"}] }', [ 'searchbox' ] ], 37 [ '{"name": "hr"}', [ 'separator' ] ], 38 [ '{"name": "dt"}', [ 'term' ] ], 39 [ '{"name": "dfn"}', [ 'term' ] ], 40 [ '{"name": "textarea"}', [ 'textbox' ] ], 41 [ '{"name": "input", "attributes": [ {"name": "type", "value": "text"}] }', [ 'textbox' ] ], 42]
The map of elements to roles is keyed by an HTML concept. An HTML concept corresponds to the baseConcepts
and relatedConcepts
of an ARIA role. Concepts exist in the context of a module
: HTML, XForms, Dublin Core, for example. The concept representation is an object literal with a name property (the element name) and an optional attributes array.
The roles are provided in a Set.
1import { roleElements } from 'aria-query';
ARIA roles are mapped to the HTML Elements with the same inherent role. Some roles, such as columnheader
are only mapped to an HTML element that expresses specific attributes. In the case of <input>
, the element often requires a type
attribute to map to an ARIA role.
1[ 2 [ 'article', [ {"name": "article"} ] ], 3 [ 'button', [ {"name": "button"} ] ], 4 [ 'cell', [ {"name": "td"} ] ], 5 [ 'checkbox', [ {"name": "input", "attributes": [ {"name": "type", "value": "checkbox"}] } ] ], 6 [ 'columnheader', [ {"name": "th"} ] ], 7 [ 'combobox', [ {"name": "select"} ] ], 8 [ 'command', [ {"name": "menuitem"} ] ], 9 [ 'definition', [ {"name": "dd"}', '{"name": "dfn"} ] ], 10 [ 'figure', [ {"name": "figure"} ] ], 11 [ 'form', [ {"name": "form"} ] ], 12 [ 'grid', [ {"name": "table"} ] ], 13 [ 'gridcell', [ {"name": "td"} ] ], 14 [ 'group', [ {"name": "fieldset"} ] ], 15 [ 'heading', [ {"name": "h1"}', '{"name": "h2"}', '{"name": "h3"}', '{"name": "h4"}', '{"name": "h5"}', '{"name": "h6"} ] ], 16 [ 'img', [ {"name": "img"} ] ], 17 [ 'link', [ {"name": "a"}', '{"name": "link"} ] ], 18 [ 'list', [ {"name": "ol"}', '{"name": "ul"} ] ], 19 [ 'listbox', [ {"name": "select"} ] ], 20 [ 'listitem', [ {"name": "li"} ] ], 21 [ 'menuitem', [ {"name": "menuitem"} ] ], 22 [ 'navigation', [ {"name": "nav"} ] ], 23 [ 'option', [ {"name": "option"} ] ], 24 [ 'radio', [ {"name": "input", "attributes": [ {"name": "type", "value": "radio"}] } ] ], 25 [ 'region', [ {"name": "frame"} ] ], 26 [ 'roletype', [ {"name": "rel"} ] ], 27 [ 'row', [ {"name": "tr"} ] ], 28 [ 'rowgroup', [ {"name": "tbody"}', '{"name": "tfoot"}', '{"name": "thead"} ] ], 29 [ 'rowheader', [ {"name": "th", "attributes": [ {"name": "scope", "value": "row"}] }, {"name": "th", "attributes": [ {"name": "scope", "value": "rowgroup"}] } ] ], 30 [ 'searchbox', [ {"name": "input", "attributes": [ {"name": "type", "value": "search"}] } ] ], 31 [ 'separator', [ {"name": "hr"} ] ], 32 [ 'table', [ {"name": "table"} ] ], 33 [ 'term', [ {"name": "dt"} ] ], 34 [ 'textbox', [ {"name": "textarea"}', '{"name": "input", "attributes": [ {"name": "type", "value": "text"}] } ] ], 35]
Copyright (c) 2021 A11yance
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 8
Details
Reason
Found 9/23 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More