carbon-react
Version:
A library of reusable React components for easily building user interfaces.
34 lines (33 loc) • 1.69 kB
TypeScript
import React from "react";
import { MarginProps } from "styled-system";
import { TagProps } from "../../../__internal__/utils/helpers/tags/tags";
type LOADER_VARIANTS = "typical" | "ai" | "stacked" | "inline";
type LOADER_SIZES = "extra-small" | "small" | "medium" | "large";
type LOADER_TYPES = "standalone" | "ring" | "star";
type CommonLoaderProps = {
/** Specify a label for the loader*/
loaderLabel?: string;
/** Specify if the label should be visible or not */
showLabel?: boolean;
/** If set to `false` all motion will be suspended */
hasMotion?: boolean;
/** If set to `true` the animation type will become tracked, this is used specifically for when wait times are predictable */
isTracked?: boolean;
/** Specify a custom animation time for the loader */
animationTime?: number;
/** Toggle the inverse color scheme */
inverse?: boolean;
/** The loader type can be specified in order to change the loader */
loaderType?: LOADER_TYPES;
/** The size prop allows a specific size to be set ranging from `extra-small` to `large` */
size?: LOADER_SIZES;
/** Toggle between the different Loader variants */
variant?: LOADER_VARIANTS;
/** Enable the success state for the ring loader when it is tracked */
isSuccess?: boolean;
/** Enable the error state for the ring loader when it is tracked */
isError?: boolean;
};
export type LoaderProps = MarginProps & TagProps & CommonLoaderProps;
export declare const Loader: ({ animationTime, hasMotion, isTracked, loaderLabel, showLabel, loaderType, size, variant, inverse, isSuccess, isError, ...rest }: LoaderProps) => React.JSX.Element;
export default Loader;