@agney/react-loading
Version:
<h2 align="center">React Loading</h2> <p align="center"> Simple and Accessible loading indicators with React. <br /> <br /> <a href="https://www.npmjs.com/package/@agney/react-loading"> <img src="https://badge.fury.io/js/%40agney%2Freact-loading.svg" />
23 lines (22 loc) • 911 B
TypeScript
import { ReactElement } from 'react';
interface Props {
loading?: boolean;
indicator?: ReactElement | null;
loaderProps?: {
/** Description of progressbar and what it is loading */
valueText?: string;
};
}
declare type AriaLive = 'off' | 'assertive' | 'polite' | undefined;
/**
* Hook returning Indicator element according to loading argument.
* @example const { containerProps, indicatorEl } = useLoading({ loading: true })
*/
export declare function useLoading({ loading, indicator, loaderProps }: Props): {
containerProps: {
'aria-busy': boolean;
'aria-live': AriaLive;
};
indicatorEl: ReactElement<any, string | ((props: any) => ReactElement<any, string | any | (new (props: any) => import("react").Component<any, any, any>)> | null) | (new (props: any) => import("react").Component<any, any, any>)> | null;
};
export {};