@wordpress/a11y
Version:
Accessibility (a11y) utilities for WordPress.
20 lines • 881 B
TypeScript
/**
* Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
* This module is inspired by the `speak` function in `wp-a11y.js`.
*
* @param message The message to be announced by assistive technologies.
* @param [ariaLive] The politeness level for aria-live; default: 'polite'.
*
* @example
* ```js
* import { speak } from '@wordpress/a11y';
*
* // For polite messages that shouldn't interrupt what screen readers are currently announcing.
* speak( 'The message you want to send to the ARIA live region' );
*
* // For assertive messages that should interrupt what screen readers are currently announcing.
* speak( 'The message you want to send to the ARIA live region', 'assertive' );
* ```
*/
export declare function speak(message: string, ariaLive?: 'polite' | 'assertive'): void;
//# sourceMappingURL=index.d.ts.map