1. Domino UI
  2. Components
  3. Loaders
Top Basic Docs

Lists

The Loader class is responsible for displaying loading animations on a target DOM element.

Usage:

 
 Loader loader = Loader.create(someElement, LoaderEffect.SOME_EFFECT);
 loader.start();
 // ... do some work
 loader.stop();
 

Examples

Basic loaders Different loaders styles to mask other elements.

API Docs: Loader

Static methods

public static Loader create(HTMLElement target, LoaderEffect effect)
Static factory method to create a Loader instance.

target

The target HTMLElement where the loader will be shown.

effect

The loading effect to be applied.



Returns:

A new Loader instance.

public static Loader create(IsElement<?> target, LoaderEffect effect)
Static factory method to create a Loader instance.

target

The target IsElement where the loader will be shown.

effect

The loading effect to be applied.



Returns:

A new Loader instance.

Public methods

public Loader start()
Start the loader without any timeout.

Returns:

The current Loader instance.

public Loader start(int timeout)
Start the loader with a specified timeout.

timeout

The time in milliseconds after which the loader should stop automatically.



Returns:

The current Loader instance.

public Loader stop()
Stops the loader.

Returns:

The current Loader instance.

public Loader setLoadingText(String text)
Set the text to be displayed during loading.

text

The loading text.



Returns:

The current Loader instance.

public Loader setSize(String width, String height)
Set the size for the loader.

width

Width of the loader.

height

Height of the loader.



Returns:

The current Loader instance.

public Loader setRemoveLoadingText(boolean removeLoadingText)
Configure the loader to remove the loading text.

removeLoadingText

Whether to remove the loading text or not.



Returns:

The current Loader instance.

public boolean isStarted()
Check if the loader has started.

Returns:

true if the loader is running, otherwise false .

public Loader setLoadingTextPosition(LoadingTextPosition loadingTextPosition)
Set the position for the loading text.

loadingTextPosition

The desired position for the loading text.



Returns:

The current Loader instance.

public IsLoader getLoaderElement()
Get the current loader element being used.

Returns:

The loader element.

We are a group of passionate people who love what we do

Donate & Support Us