Disable kivy button using .kv file Last Updated : 12 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we will learn how to disable a button in kivy using .kv file, there are some places where we need to disable the buttons. Let's see how to do that. Kivy Tutorial – Learn Kivy with Examples. The Button is a Label with associated actions that are triggered when the button is pressed (or released after a click/touch). We can add functions behind the button and style the button.But to disable the button we have a property name : disabled that must be true this property will help in disabling the button i.e. button will be there but is of no use as it is disabled no functionality of button will work. In this article we have used Relative Layout to set the position of both working and disabled button relative. Note: disabled property was introduced in version 1.8.0. If you want to use it you need to actualize your framework. Basic Approach to disable a button 1) import kivy 2) import kivyApp 3) import Widget 4) import Button 5) Set minimum version(optional) 6) Create widget class: 1) Arrange a callback 2) Define Callback function 7) create App class 8) create .kv file (name same as the app class): 1) create Widget 2) Create Button 3) Specify requirements 4) Disable button true if required 9) return Layout/widget/Class(according to requirement) 10) Run an instance of the class Code to implement the Approach to disable button Python3 ## Sample Python application demonstrating the ## How to disable button in Kivy using .kv file ################################################### # import modules import kivy # base Class of your App inherits from the App class. # app:always refers to the instance of your application from kivy.app import App # This layout allows you to set relative coordinates for children. from kivy.uix.relativelayout import RelativeLayout # To change the kivy default settings # we use this module config from kivy.config import Config # 0 being off 1 being on as in true / false # you can use 0 or 1 && True or False Config.set('graphics', 'resizable', True) # creating the root widget used in .kv file class RelativeLayout(RelativeLayout): pass # creating the App class in which name #.kv file is to be named Btn.kv class BtnApp(App): # defining build() def build(self): # returning the instance of root class return RelativeLayout() # run the app if __name__ == "__main__": BtnApp().run() .kv file implementation of the approach Python3 #.kv file implementation of RelativeLayout <RelativeLayout>: # creating the Disabled button Button: text:"B1" background_color: 0.1, 0.5, 0.6, 1 # positioned at 0 % in x axis and 0 % in y axis # from bottom left, i.e x, y = 0, 0 from bottom left: pos_hint: {"x":0.2, "y":.4} size_hint: 0.3, 0.2 # Disabling button disabled: True # working button Button: text:"B2" background_color: 1, 0, 0, 1 pos_hint: {"x":.6, "y":.4} size_hint: 0.3, 0.2 Output: Here, B1 is disabled and B2 is working. Comment More infoAdvertise with us Next Article Disable Kivy Button Y YashKhandelwal8 Follow Improve Article Tags : Python Python-gui Python-kivy Practice Tags : python Similar Reads Add image button using .kv file in kivy Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications.As we have discussed earlier that how to work with images and now 3 min read Add image button using .kv file in kivy Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications.As we have discussed earlier that how to work with images and now 3 min read Disable Kivy Button In this article, we will learn how to disable a button in kivy, there are some places where we need to disable the buttons So in this article you will learn how to do that. Kivy Tutorial â Learn Kivy with Examples. The Button is a Label with associated actions that are triggered when the button is p 3 min read Python - Change button color in kivy using .kv file Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, Linux and Windows, etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications. In this article we will learn how to change the background colo 3 min read Python | Toggle button in kivy using .kv file Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications. ???????? Kivy Tutorial - Learn Kivy with Examples. Toggle button 3 min read Python | Toggle button in kivy using .kv file Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications. ???????? Kivy Tutorial - Learn Kivy with Examples. Toggle button 3 min read Like