package.src.components.Spinner.Spinner.tsx Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react-core Show documentation
Show all versions of react-core Show documentation
This library provides a set of common React components for use with the PatternFly reference implementation.
The newest version!
import * as React from 'react';
import styles from '@patternfly/react-styles/css/components/Spinner/spinner';
import { css } from '@patternfly/react-styles';
import cssDiameter from '@patternfly/react-tokens/dist/esm/c_spinner_diameter';
export enum spinnerSize {
sm = 'sm',
md = 'md',
lg = 'lg',
xl = 'xl'
}
export interface SpinnerProps extends React.SVGProps {
/** Additional classes added to the Spinner. */
className?: string;
/** Size variant of progress. */
size?: 'sm' | 'md' | 'lg' | 'xl';
/** Text describing that current loading status or progress */
'aria-valuetext'?: string;
/** Diameter of spinner set as CSS variable */
diameter?: string;
/** @beta Indicates the spinner is inline and the size should inherit the text font size. This will override the size prop. */
isInline?: boolean;
/** Accessible label to describe what is loading */
'aria-label'?: string;
/** Id of element which describes what is being loaded */
'aria-labelledBy'?: string;
}
export const Spinner: React.FunctionComponent = ({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
className = '',
size = 'xl',
'aria-valuetext': ariaValueText = 'Loading...',
diameter,
isInline = false,
'aria-label': ariaLabel,
'aria-labelledBy': ariaLabelledBy,
...props
}: SpinnerProps) => (
);
Spinner.displayName = 'Spinner';