UNPKG

1.12 kBTypeScriptView Raw
1import * as React from "react";
2import { BoxProps } from "../Box";
3import { Omit } from "../common-types";
4
5export interface ISpinnerProps {
6 /**
7 * The size of the spinner
8 */
9 size?: "xs" | "sm" | "md" | "lg" | "xl";
10 /**
11 * The color of the empty area in the spinner
12 */
13 emptyColor?: string;
14 /**
15 * The color of the spinner
16 */
17 color?: string;
18 /**
19 * The thickness of the spinner
20 * @example
21 * ```jsx
22 * <Spinner thickness="4px"/>
23 * ```
24 */
25 thickness?: string;
26 /**
27 * The speed of the spinner.
28 * @example
29 * ```jsx
30 * <Spinner speed="0.2s"/>
31 * ```
32 */
33 speed?: string;
34 /**
35 * For accessibility, it's important to add a fallback loading text.
36 * This text will be visible to screen readers.
37 */
38 label?: string;
39}
40
41export type SpinnerProps = Omit<BoxProps, "size"> & ISpinnerProps;
42
43/**
44 * Spinner is used for indicating a loading state of a component or page.
45 *
46 * RECOMMENDED: Add `aria-busy="true"` to the component that triggered the loading state while the spinner is shown.
47 */
48declare const Spinner: React.FC<SpinnerProps>;
49
50export default Spinner;