Skip to content

Loader ​

Storybook

Browse the props, controls and all the stories of Loader in Storybook.

The Loader component displays a spinning icon over a white overlay while content is loading. It renders nothing when isActive is false. The overlay is absolutely positioned, so place the loader inside a container with position: relative.

Usage ​

tsx
import { Loader } from "@tsed/react-formio/molecules/loader/Loader";

<div className="relative">
  <Loader isActive={isLoading} />
  {/* content */}
</div>;

Props ​

Loader also accepts the native attributes of a div element.

NameTypeDefaultDescription
isActivebooleanDisplays the loader when true, renders nothing otherwise.
colorstring"text-primary"CSS class applied to the icon to set its color.
iconstring"loader"Name of the icon to display.
iconsetstringIcon set used to resolve the icon (for example bx or lu).
classNamestring""Additional CSS classes on the overlay.

Example ​

Live exampleOpen in Storybook ↗

Released under the MIT License.