Quick search

Table Of Contents


New in version 1.0.7.


The Popup widget is used to create modal popups. By default, the popup will cover the whole “parent” window. When you are creating a popup, you must at least set a Popup.title and Popup.content.

Remember that the default size of a Widget is size_hint=(1, 1). If you don’t want your popup to be fullscreen, either use size hints with values less than 1 (for instance size_hint=(.8, .8)) or deactivate the size_hint and use fixed size attributes.

Changed in version 1.4.0: The Popup class now inherits from ModalView. The Popup offers a default layout with a title and a separation bar.


Example of a simple 400x400 Hello world popup:

popup = Popup(title='Test popup',
    content=Label(text='Hello world'),
    size_hint=(None, None), size=(400, 400))

By default, any click outside the popup will dismiss/close it. If you don’t want that, you can set auto_dismiss to False:

popup = Popup(title='Test popup', content=Label(text='Hello world'),

To manually dismiss/close the popup, use dismiss:


Both open() and dismiss() are bindable. That means you can directly bind the function to an action, e.g. to a button’s on_press:

# create content and add to the popup
content = Button(text='Close me!')
popup = Popup(content=content, auto_dismiss=False)

# bind the on_press event of the button to the dismiss function

# open the popup

Same thing in KV language only with Factory:

#:import Factory kivy.factory.Factory
    auto_dismiss: False
        text: 'Close me!'
        on_release: root.dismiss()

    text: 'Open popup'
    on_release: Factory.MyPopup().open()


Popup is a special widget. Don’t try to add it as a child to any other widget. If you do, Popup will be handled like an ordinary widget and won’t be created hidden in the background.

    MyPopup:  # bad!