@durkdotdev/aria-types
v1.1.2
Published
Type definitions for WAI-ARIA Accessibility.
Readme
@durkdotdev/aria-types
Type definitions for WAI-ARIA Accessibility.
Installation
npm install @durkdotdev/aria-types -D
# or
yarn add @durkdotdev/aria-types -D
# or
pnpm add @durkdotdev/aria-types -DUsage
import { AriaTypes } from "@durkdotdev/aria-types";
const aria: AriaTypes = {
"aria-atomic": "true",
role: "alert"
};Requiring Aria Attributes
@durkdotdev/aria-types exports a generic type to enforce required aria attributes:
import { PartiallyRequiredAriaTypes } from "@durkdotdev/aria-types";
const aria: PartiallyRequiredAriaTypes<"aria-atomic" | "role"> = {
"aria-atomic": "true",
role: "alert"
};Types
@durkdotdev/aria-types exports the following types:
| Name | Description | | -------------------------- | ----------------------------------- | | AriaAttributes | typed aria attributes | | AriaAttributesDragAndDrop | typed drag-and-drop aria attributes | | AriaAttributesGlobal | typed global aria attributes | | AriaAttributesLiveRegion | typed live region aria attributes | | AriaAttributesRelationship | typed relationship aria attributes | | AriaAttributesWidget | typed widget aria attributes | | AriaRole | typed aria role | | AriaRoleComposite | typed composite aria role | | AriaRoleDocumentStructure | typed document structure aria role | | AriaRoleLandmark | typed landmark aria role | | AriaRoleLiveRegion | typed live region aria role | | AriaRoleWidget | typed widget aria role | | AriaRoleWindow | typed window aria role |
In addition, the following arrays are exported:
| Name | Description | | -------------------------- | -------------------------------------- | | ariaAttributes | array of aria attributes | | ariaAttributesDragAndDrop | array of drag-and-drop aria attributes | | ariaAttributesGlobal | array of global aria attributes | | ariaAttributesLiveRegion | array of live region attributes | | ariaAttributesRelationship | array of relationship aria attributes | | ariaAttributesWidget | array of widget aria attributes | | ariaRoles | array of aria roles | | ariaRolesComposite | array of composite aria roles | | ariaRolesDocumentStructure | array of document structure aria roles | | ariaRolesLandmark | array of landmark aria roles | | ariaRolesLiveRegion | array of live region aria roles | | ariaRolesWidget | array of widget aria roles | | ariaRolesWindow | array of window aria roles |
Resources
For more resources on WAI-ARIA:
