LoadingIndicator#

#

Loading indicators display the status of a process using continuous or sequential shape animations.

  • Used to represent indeterminate operations (no fixed end).

  • Each shape is based on Material 3 geometry guidelines.

  • Animations can cycle between multiple predefined shapes.

Usage#

from kivy.clock import Clock
from kivy.lang import Builder
from kivymd.app import MDApp

KV = '''
MDScreen:
    md_bg_color: app.theme_cls.surfaceColor
    MDLoadingIndicator:
        id: indicator
        shape_size: dp(100)
'''


class ExampleApp(MDApp):

    def build(self):
        return Builder.load_string(KV)

    def on_start(self):
        # start the morphing animation
        self.root.ids.indicator.start()

        # print available shape names
        print(self.root.ids.indicator.get_shape_names())

        # optionally stop animation after 5 seconds
        # Clock.schedule_once(self.root.ids.indicator.stop, 5)


ExampleApp().run()
https://github.com/user-attachments/assets/1a24f741-a710-4271-993b-5a335a284787

API - kivymd.uix.loadingindicator.loadingindicator#

class kivymd.uix.loadingindicator.loadingindicator.MDLoadingIndicator(*args, **kwargs)#

Implementation of a morphing and rotating loading indicator.

For more information, see the AnchorLayout and RotateBehavior classes documentation.

shape#

Current shape name displayed by the loading indicator.

The shape corresponds to one of the predefined shapes available in the MaterialShape library.

You can view all available shape names using get_shape_names().

shape is a StringProperty and defaults to ‘cookie12Sided’.

shape_sequence#

Sequence of shape names through which the indicator cycles.

Each shape in the list is morphed into the next one over time, looping continuously while the indicator is active.

shape_sequence is a ListProperty and defaults to:

[
    "cookie12Sided",
    "pentagon",
    "pill",
    "verySunny",
    "cookie4Sided",
    "oval",
    "flower",
    "softBoom",
]
shape_size#

Size of the loading indicator.

shape_size is a NumericProperty and defaults to dp(48).

duration#

Duration of one morph-and-rotate cycle in seconds.

This value controls the overall speed of the loading indicator.

duration is a NumericProperty and defaults to 0.65.

active_indicator_color#

Color of the active (foreground) loading shape.

active_indicator_color is a ColorProperty and defaults to None.

container_color#

Background container color of the indicator.

container_color is a ColorProperty and defaults to None.

shape_index#

Current index in the shape_sequence.

shape_index is a NumericProperty and defaults to 0.

start(*args)#

Start the loading animation.

Initiates the shape morphing and rotation cycle. The indicator continuously transitions between the shapes defined in shape_sequence while rotating at regular intervals.

If already active, the animation sequence is reset.

stop(*args)#

Stop the loading animation.

get_shape_names()#

Return all available material shape names.