@primer/react
Version:
An implementation of GitHub's Primer Design System using React
35 lines (34 loc) • 1.16 kB
TypeScript
import { PolymorphicProps } from "../utils/modern-polymorphic.js";
import React from "react";
//#region src/live-region/Announce.d.ts
type AnnounceProps<As extends React.ElementType> = PolymorphicProps<As, 'div', {
/**
* Specify if the content of the element should be announced when this
* component is rendered and is not hidden
* @default false
*/
announceOnShow?: boolean;
/**
* Specify if the element is hidden
* @default false
*/
hidden?: boolean;
/**
* Provide a delay in milliseconds before the announcement is made. This will
* only work with `polite` announcements
*/
delayMs?: number;
/**
* The politeness level to use for the announcement
* @default 'polite'
*/
politeness?: 'assertive' | 'polite';
}>;
/**
* `Announce` is a component that will announce the text content of the
* `children` passed in to screen readers using the given politeness level. It
* will also announce any changes to the text content of `children`
*/
declare function Announce<As extends React.ElementType = 'div'>(props: AnnounceProps<As>): React.JSX.Element;
//#endregion
export { Announce, AnnounceProps };