How to Change the Screen Transition in Kivy

Rachela
Nerd For Tech
Published in
1 min readAug 6, 2021

--

The default transition is the SlideTransition, but there are many different types. You can also specify NoTransition.

Since the slide transition is the default, it is not necessary to import anything. You need to import all other transitions in the .kv file at the top of your file.

This is a screenshot from the Kivy Screen Manager page with the available transitions: https://kivy.org/doc/stable/api-kivy.uix.screenmanager.html

Use this syntax in your ScreenManager in your .kv file to change the default transition:

#: import WipeTransition kivy.uix.screenmanager.WipeTransition<ScreenManager>:
transition: WipeTransition()

You can change the transition within your file. **Important: Once you change the transition in one location, it will apply to all the following transitions unless you specifically change it again.**

#: import WipeTransition kivy.uix.screenmanager.WipeTransition<ExampleScreen>:    GridLayout:
cols: 1
Button:
text: "Change the Direction of Default SlideTransition":
on_release:
root.manager.transition.direction = "right"
root.manager.current = "new_screen"
Button:
text: "Change Transition Type"
on_release:
root.manager.transition = WipeTransition()
root.manager.current = "new_screen"

--

--

Rachela
Nerd For Tech

I am a librarian and new computer programmer creating an app with Python and Kivy to document the plants in my garden.