Table Of Contents
WidgetsΒΆ
Widgets are elements of a graphical user interface that form part of the User Experience. The kivy.uix module contains classes for creating and managing Widgets. Please refer to the Widget class documentation for further information.
Kivy widgets can be categorized as follows:
UX widgets: Classical user interface widgets, ready to be assembled to create more complex widgets.
Layouts: A layout widget does no rendering but just acts as a trigger that arranges its children in a specific way. Read more on Layouts here.
Complex UX widgets: Non-atomic widgets that are the result of combining multiple classic widgets. We call them complex because their assembly and usage are not as generic as the classical widgets.
Behaviors widgets: These widgets do no rendering but act on the graphics instructions or interaction (touch) behavior of their children.
Screen manager: Manages screens and transitions when switching from one to another.
- Behaviors
- Behavior mixin classes
- Adding behaviors
ButtonBehaviorCodeNavigationBehaviorCompoundSelectionBehaviorCompoundSelectionBehavior.clear_selection()CompoundSelectionBehavior.deselect_node()CompoundSelectionBehavior.get_index_of_node()CompoundSelectionBehavior.get_selectable_nodes()CompoundSelectionBehavior.goto_node()CompoundSelectionBehavior.keyboard_selectCompoundSelectionBehavior.multiselectCompoundSelectionBehavior.nodes_order_reversedCompoundSelectionBehavior.page_countCompoundSelectionBehavior.right_countCompoundSelectionBehavior.scroll_countCompoundSelectionBehavior.select_node()CompoundSelectionBehavior.select_with_key_down()CompoundSelectionBehavior.select_with_key_up()CompoundSelectionBehavior.select_with_touch()CompoundSelectionBehavior.selected_nodesCompoundSelectionBehavior.text_entry_timeoutCompoundSelectionBehavior.touch_deselect_lastCompoundSelectionBehavior.touch_multiselectCompoundSelectionBehavior.up_count
CoverBehaviorDragBehaviorEmacsBehaviorFocusBehaviorFocusBehavior.focusFocusBehavior.focus_nextFocusBehavior.focus_previousFocusBehavior.focusedFocusBehavior.get_focus_next()FocusBehavior.get_focus_previous()FocusBehavior.hide_keyboard()FocusBehavior.ignored_touchFocusBehavior.input_typeFocusBehavior.is_focusableFocusBehavior.keyboardFocusBehavior.keyboard_modeFocusBehavior.keyboard_on_key_down()FocusBehavior.keyboard_on_key_up()FocusBehavior.keyboard_suggestionsFocusBehavior.show_keyboard()FocusBehavior.unfocus_on_touch
ToggleButtonBehaviorTouchRippleBehaviorTouchRippleBehavior.ripple_duration_inTouchRippleBehavior.ripple_duration_outTouchRippleBehavior.ripple_fade()TouchRippleBehavior.ripple_fade_from_alphaTouchRippleBehavior.ripple_fade_to_alphaTouchRippleBehavior.ripple_func_inTouchRippleBehavior.ripple_func_outTouchRippleBehavior.ripple_rad_defaultTouchRippleBehavior.ripple_scaleTouchRippleBehavior.ripple_show()
TouchRippleButtonBehavior- Button Behavior
- Code Navigation Behavior
- Compound Selection Behavior
- Compound selection concepts
- Selection mechanics
- Example
CompoundSelectionBehaviorCompoundSelectionBehavior.clear_selection()CompoundSelectionBehavior.deselect_node()CompoundSelectionBehavior.get_index_of_node()CompoundSelectionBehavior.get_selectable_nodes()CompoundSelectionBehavior.goto_node()CompoundSelectionBehavior.keyboard_selectCompoundSelectionBehavior.multiselectCompoundSelectionBehavior.nodes_order_reversedCompoundSelectionBehavior.page_countCompoundSelectionBehavior.right_countCompoundSelectionBehavior.scroll_countCompoundSelectionBehavior.select_node()CompoundSelectionBehavior.select_with_key_down()CompoundSelectionBehavior.select_with_key_up()CompoundSelectionBehavior.select_with_touch()CompoundSelectionBehavior.selected_nodesCompoundSelectionBehavior.text_entry_timeoutCompoundSelectionBehavior.touch_deselect_lastCompoundSelectionBehavior.touch_multiselectCompoundSelectionBehavior.up_count
- Cover Behavior
- Drag Behavior
- Emacs Behavior
- Focus Behavior
- Managing focus
- Initializing focus
FocusBehaviorFocusBehavior.focusFocusBehavior.focus_nextFocusBehavior.focus_previousFocusBehavior.focusedFocusBehavior.get_focus_next()FocusBehavior.get_focus_previous()FocusBehavior.hide_keyboard()FocusBehavior.ignored_touchFocusBehavior.input_typeFocusBehavior.is_focusableFocusBehavior.keyboardFocusBehavior.keyboard_modeFocusBehavior.keyboard_on_key_down()FocusBehavior.keyboard_on_key_up()FocusBehavior.keyboard_suggestionsFocusBehavior.show_keyboard()FocusBehavior.unfocus_on_touch
- Kivy Namespaces
- ToggleButton Behavior
- Touch Ripple
TouchRippleBehaviorTouchRippleBehavior.ripple_duration_inTouchRippleBehavior.ripple_duration_outTouchRippleBehavior.ripple_fade()TouchRippleBehavior.ripple_fade_from_alphaTouchRippleBehavior.ripple_fade_to_alphaTouchRippleBehavior.ripple_func_inTouchRippleBehavior.ripple_func_outTouchRippleBehavior.ripple_rad_defaultTouchRippleBehavior.ripple_scaleTouchRippleBehavior.ripple_show()
TouchRippleButtonBehavior
- RecycleView
- Viewclass State
RecycleViewRecycleViewBehavior- RecycleView Data Model
- RecycleView Layouts
LayoutChangeExceptionLayoutSelectionBehaviorRecycleLayoutManagerBehaviorRecycleLayoutManagerBehavior.compute_visible_views()RecycleLayoutManagerBehavior.get_view_index_at()RecycleLayoutManagerBehavior.goto_view()RecycleLayoutManagerBehavior.key_viewclassRecycleLayoutManagerBehavior.refresh_view_layout()RecycleLayoutManagerBehavior.set_visible_views()RecycleLayoutManagerBehavior.viewclass
- RecycleView Views
RecycleDataAdapterRecycleDataAdapter.attach_recycleview()RecycleDataAdapter.create_view()RecycleDataAdapter.detach_recycleview()RecycleDataAdapter.get_view()RecycleDataAdapter.get_visible_view()RecycleDataAdapter.invalidate()RecycleDataAdapter.make_view_dirty()RecycleDataAdapter.make_views_dirty()RecycleDataAdapter.recycleviewRecycleDataAdapter.refresh_view_attrs()RecycleDataAdapter.refresh_view_layout()RecycleDataAdapter.set_visible_views()
RecycleDataViewBehaviorRecycleKVIDsDataViewBehavior
- Accordion
- Simple example
- Customize the accordion
AccordionAccordionExceptionAccordionItemAccordionItem.accordionAccordionItem.add_widget()AccordionItem.background_disabled_normalAccordionItem.background_disabled_selectedAccordionItem.background_normalAccordionItem.background_selectedAccordionItem.collapseAccordionItem.collapse_alphaAccordionItem.containerAccordionItem.container_titleAccordionItem.content_sizeAccordionItem.min_spaceAccordionItem.on_touch_down()AccordionItem.orientationAccordionItem.remove_widget()AccordionItem.titleAccordionItem.title_argsAccordionItem.title_template
- Action Bar
- Anchor Layout
- Box Layout
- Bubble
- Button
- Camera
- Carousel
CarouselCarousel.add_widget()Carousel.anim_cancel_durationCarousel.anim_move_durationCarousel.anim_typeCarousel.clear_widgets()Carousel.current_slideCarousel.directionCarousel.ignore_perpendicular_swipesCarousel.indexCarousel.load_next()Carousel.load_previous()Carousel.load_slide()Carousel.loopCarousel.min_moveCarousel.next_slideCarousel.on_touch_down()Carousel.on_touch_move()Carousel.on_touch_up()Carousel.previous_slideCarousel.remove_widget()Carousel.scroll_distanceCarousel.scroll_timeoutCarousel.slides
- CheckBox
CheckBoxCheckBox.activeCheckBox.background_checkbox_disabled_downCheckBox.background_checkbox_disabled_normalCheckBox.background_checkbox_downCheckBox.background_checkbox_normalCheckBox.background_radio_disabled_downCheckBox.background_radio_disabled_normalCheckBox.background_radio_downCheckBox.background_radio_normalCheckBox.color
- Code Input
- Color Picker
- Drop-Down List
- Basic example
- Extending dropdown in Kv
DropDownDropDown.add_widget()DropDown.attach_toDropDown.auto_dismissDropDown.auto_widthDropDown.clear_widgets()DropDown.containerDropDown.dismiss()DropDown.dismiss_on_selectDropDown.max_heightDropDown.min_state_timeDropDown.on_motion()DropDown.on_touch_down()DropDown.on_touch_move()DropDown.on_touch_up()DropDown.open()DropDown.remove_widget()DropDown.select()
- EffectWidget
- FileChooser
- Simple widgets
- Widget composition
- Usage example
FileChooserFileChooserControllerFileChooserController.cancel()FileChooserController.dirselectFileChooserController.entry_released()FileChooserController.entry_touched()FileChooserController.file_encodingsFileChooserController.file_systemFileChooserController.filesFileChooserController.filter_dirsFileChooserController.filtersFileChooserController.font_nameFileChooserController.get_nice_size()FileChooserController.layoutFileChooserController.multiselectFileChooserController.on_touch_down()FileChooserController.on_touch_up()FileChooserController.pathFileChooserController.progress_clsFileChooserController.rootpathFileChooserController.selectionFileChooserController.show_hiddenFileChooserController.sort_func
FileChooserIconLayoutFileChooserIconViewFileChooserListLayoutFileChooserListViewFileChooserProgressBaseFileSystemAbstractFileSystemLocal
- Float Layout
- Gesture Surface
- Grid Layout
- Background
- Column Width and Row Height
- Using a GridLayout
GridLayoutGridLayout.col_default_widthGridLayout.col_force_defaultGridLayout.colsGridLayout.cols_minimumGridLayout.do_layout()GridLayout.minimum_heightGridLayout.minimum_sizeGridLayout.minimum_widthGridLayout.orientationGridLayout.paddingGridLayout.row_default_heightGridLayout.row_force_defaultGridLayout.rowsGridLayout.rows_minimumGridLayout.spacing
GridLayoutException
- Image
- Label
- Sizing and text content
- Text alignment and wrapping
- Markup text
- Interactive zone in text
- Catering for Unicode languages
- Usage example
LabelLabel.anchorsLabel.base_directionLabel.boldLabel.colorLabel.disabled_colorLabel.disabled_outline_colorLabel.ellipsis_optionsLabel.font_blendedLabel.font_contextLabel.font_directionLabel.font_familyLabel.font_featuresLabel.font_hintingLabel.font_kerningLabel.font_nameLabel.font_script_nameLabel.font_sizeLabel.halignLabel.is_shortenedLabel.italicLabel.limit_render_to_text_bboxLabel.line_heightLabel.markupLabel.max_linesLabel.mipmapLabel.on_touch_down()Label.outline_colorLabel.outline_widthLabel.paddingLabel.padding_xLabel.padding_yLabel.refsLabel.shortenLabel.shorten_fromLabel.split_strLabel.strikethroughLabel.stripLabel.textLabel.text_languageLabel.text_sizeLabel.textureLabel.texture_sizeLabel.texture_update()Label.underlineLabel.unicode_errorsLabel.valign
- Layout
- ModalView
- Examples
- ModalView Events
ModalViewModalView.attach_toModalView.auto_dismissModalView.backgroundModalView.background_colorModalView.borderModalView.dismiss()ModalView.on__anim_alpha()ModalView.on_dismiss()ModalView.on_motion()ModalView.on_open()ModalView.on_pre_dismiss()ModalView.on_pre_open()ModalView.on_touch_down()ModalView.on_touch_move()ModalView.on_touch_up()ModalView.open()ModalView.overlay_color
- PageLayout
- Popup
- Progress Bar
- RecycleBoxLayout
- RecycleGridLayout
- RecycleLayout
RecycleLayoutRecycleLayout.default_heightRecycleLayout.default_pos_hintRecycleLayout.default_sizeRecycleLayout.default_size_hintRecycleLayout.default_size_hint_maxRecycleLayout.default_size_hint_minRecycleLayout.default_size_hint_xRecycleLayout.default_size_hint_x_maxRecycleLayout.default_size_hint_x_minRecycleLayout.default_size_hint_yRecycleLayout.default_size_hint_y_maxRecycleLayout.default_size_hint_y_minRecycleLayout.default_widthRecycleLayout.do_layout()RecycleLayout.initial_heightRecycleLayout.initial_sizeRecycleLayout.initial_widthRecycleLayout.key_pos_hintRecycleLayout.key_sizeRecycleLayout.key_size_hintRecycleLayout.key_size_hint_maxRecycleLayout.key_size_hint_minRecycleLayout.refresh_view_layout()RecycleLayout.set_visible_views()
- Relative Layout
- reStructuredText renderer
- Usage with Text
- Usage with Source
RstDocumentRstDocument.background_colorRstDocument.base_font_sizeRstDocument.colorsRstDocument.document_rootRstDocument.goto()RstDocument.preload()RstDocument.render()RstDocument.resolve_path()RstDocument.show_errorsRstDocument.sourceRstDocument.source_encodingRstDocument.source_errorRstDocument.textRstDocument.titleRstDocument.toctreesRstDocument.underline_color
- Sandbox
- Scatter
- Usage
- Control Interactions
- Automatic Bring to Front
- Scale Limitation
- Behavior
ScatterScatter.apply_transform()Scatter.auto_bring_to_frontScatter.bboxScatter.centerScatter.center_xScatter.center_yScatter.collide_point()Scatter.do_collide_after_childrenScatter.do_rotationScatter.do_scaleScatter.do_translationScatter.do_translation_xScatter.do_translation_yScatter.on_bring_to_front()Scatter.on_motion()Scatter.on_touch_down()Scatter.on_touch_move()Scatter.on_touch_up()Scatter.on_transform_with_touch()Scatter.posScatter.rightScatter.rotationScatter.scaleScatter.scale_maxScatter.scale_minScatter.to_local()Scatter.to_parent()Scatter.topScatter.transformScatter.transform_invScatter.translation_touchesScatter.xScatter.y
ScatterPlane
- Scatter Layout
- Screen Manager
- Basic Usage
- Changing Direction
- Advanced Usage
- Changing transitions
CardTransitionFadeTransitionFallOutTransitionNoTransitionRiseInTransitionScreenScreenManagerScreenManager.add_widget()ScreenManager.clear_widgets()ScreenManager.currentScreenManager.current_screenScreenManager.get_screen()ScreenManager.has_screen()ScreenManager.next()ScreenManager.on_motion()ScreenManager.on_touch_down()ScreenManager.on_touch_move()ScreenManager.on_touch_up()ScreenManager.previous()ScreenManager.remove_widget()ScreenManager.screen_namesScreenManager.screensScreenManager.switch_to()ScreenManager.transition
ScreenManagerExceptionShaderTransitionSlideTransitionSwapTransitionTransitionBaseWipeTransition
- ScrollView
- Scrolling Behavior
- Limiting to the X or Y Axis
- Managing the Content Size and Position
- Overscroll Effects
ScrollViewScrollView.add_widget()ScrollView.always_overscrollScrollView.bar_colorScrollView.bar_inactive_colorScrollView.bar_marginScrollView.bar_posScrollView.bar_pos_xScrollView.bar_pos_yScrollView.bar_widthScrollView.convert_distance_to_scroll()ScrollView.do_scrollScrollView.do_scroll_xScrollView.do_scroll_yScrollView.effect_clsScrollView.effect_xScrollView.effect_yScrollView.hbarScrollView.on_motion()ScrollView.on_touch_down()ScrollView.on_touch_move()ScrollView.on_touch_up()ScrollView.remove_widget()ScrollView.scroll_distanceScrollView.scroll_timeoutScrollView.scroll_to()ScrollView.scroll_typeScrollView.scroll_wheel_distanceScrollView.scroll_xScrollView.scroll_yScrollView.smooth_scroll_endScrollView.to_local()ScrollView.to_parent()ScrollView.update_from_scroll()ScrollView.vbarScrollView.viewport_size
- Settings
- Slider
SliderSlider.background_disabled_horizontalSlider.background_disabled_verticalSlider.background_horizontalSlider.background_verticalSlider.background_widthSlider.border_horizontalSlider.border_verticalSlider.cursor_disabled_imageSlider.cursor_heightSlider.cursor_imageSlider.cursor_sizeSlider.cursor_widthSlider.maxSlider.minSlider.on_touch_down()Slider.on_touch_move()Slider.on_touch_up()Slider.orientationSlider.paddingSlider.rangeSlider.sensitivitySlider.stepSlider.valueSlider.value_normalizedSlider.value_posSlider.value_trackSlider.value_track_colorSlider.value_track_width
- Spinner
- Splitter
- Stack Layout
- Stencil View
- Switch
- TabbedPanel
- Simple example
- Customize the Tabbed Panel
StripLayoutTabbedPanelTabbedPanel.add_widget()TabbedPanel.background_colorTabbedPanel.background_disabled_imageTabbedPanel.background_imageTabbedPanel.bar_widthTabbedPanel.borderTabbedPanel.clear_widgets()TabbedPanel.contentTabbedPanel.current_tabTabbedPanel.default_tabTabbedPanel.default_tab_clsTabbedPanel.default_tab_contentTabbedPanel.default_tab_textTabbedPanel.do_default_tabTabbedPanel.remove_widget()TabbedPanel.scroll_typeTabbedPanel.strip_borderTabbedPanel.strip_imageTabbedPanel.switch_to()TabbedPanel.tab_heightTabbedPanel.tab_listTabbedPanel.tab_posTabbedPanel.tab_width
TabbedPanelContentTabbedPanelExceptionTabbedPanelHeaderTabbedPanelItemTabbedPanelStrip
- Text Input
- Usage example
- Selection
- Handles
- Filtering
- Default shortcuts
TextInputTextInput.allow_copyTextInput.auto_indentTextInput.background_activeTextInput.background_colorTextInput.background_disabled_normalTextInput.background_normalTextInput.base_directionTextInput.borderTextInput.cancel_selection()TextInput.copy()TextInput.cursorTextInput.cursor_blinkTextInput.cursor_colTextInput.cursor_colorTextInput.cursor_index()TextInput.cursor_offset()TextInput.cursor_posTextInput.cursor_rowTextInput.cursor_widthTextInput.cut()TextInput.delete_selection()TextInput.disabled_foreground_colorTextInput.do_backspace()TextInput.do_cursor_movement()TextInput.do_redo()TextInput.do_undo()TextInput.do_wrapTextInput.font_contextTextInput.font_familyTextInput.font_nameTextInput.font_sizeTextInput.foreground_colorTextInput.get_cursor_from_index()TextInput.get_cursor_from_xy()TextInput.get_max_scroll_x()TextInput.halignTextInput.handle_image_leftTextInput.handle_image_middleTextInput.handle_image_rightTextInput.hint_textTextInput.hint_text_colorTextInput.input_filterTextInput.insert_text()TextInput.keyboard_on_key_down()TextInput.keyboard_on_key_up()TextInput.line_heightTextInput.line_spacingTextInput.lines_to_scrollTextInput.minimum_heightTextInput.multilineTextInput.on_cursor()TextInput.on_cursor_blink()TextInput.on_double_tap()TextInput.on_quad_touch()TextInput.on_touch_down()TextInput.on_touch_move()TextInput.on_touch_up()TextInput.on_triple_tap()TextInput.paddingTextInput.padding_xTextInput.padding_yTextInput.passwordTextInput.password_maskTextInput.paste()TextInput.pgmove_speedTextInput.readonlyTextInput.replace_crlfTextInput.reset_undo()TextInput.scroll_distanceTextInput.scroll_from_swipeTextInput.scroll_timeoutTextInput.scroll_xTextInput.scroll_yTextInput.select_all()TextInput.select_text()TextInput.selection_colorTextInput.selection_fromTextInput.selection_textTextInput.selection_toTextInput.tab_widthTextInput.textTextInput.text_languageTextInput.text_validate_unfocusTextInput.use_bubbleTextInput.use_handlesTextInput.write_tab
- Toggle button
- Tree View
- Introduction
- Creating Your Own Node Widget
TreeViewTreeView.add_node()TreeView.deselect_node()TreeView.get_node_at_pos()TreeView.hide_rootTreeView.indent_levelTreeView.indent_startTreeView.iterate_all_nodes()TreeView.iterate_open_nodes()TreeView.load_funcTreeView.minimum_heightTreeView.minimum_sizeTreeView.minimum_widthTreeView.on_touch_down()TreeView.remove_node()TreeView.rootTreeView.root_optionsTreeView.select_node()TreeView.selected_nodeTreeView.toggle_node()
TreeViewExceptionTreeViewLabelTreeViewNode
- Video
- Video player
- Annotations
- Fullscreen
- End-of-stream behavior
VideoPlayerVideoPlayer.allow_fullscreenVideoPlayer.annotationsVideoPlayer.durationVideoPlayer.fullscreenVideoPlayer.image_loadingVideoPlayer.image_overlay_playVideoPlayer.image_pauseVideoPlayer.image_playVideoPlayer.image_stopVideoPlayer.image_volumehighVideoPlayer.image_volumelowVideoPlayer.image_volumemediumVideoPlayer.image_volumemutedVideoPlayer.on_touch_down()VideoPlayer.optionsVideoPlayer.playVideoPlayer.positionVideoPlayer.seek()VideoPlayer.sourceVideoPlayer.stateVideoPlayer.thumbnailVideoPlayer.volume
VideoPlayerAnnotation
- VKeyboard
- Modes
- Layouts
- Request Keyboard
VKeyboardVKeyboard.available_layoutsVKeyboard.backgroundVKeyboard.background_borderVKeyboard.background_colorVKeyboard.background_disabledVKeyboard.callbackVKeyboard.collide_margin()VKeyboard.dockedVKeyboard.font_sizeVKeyboard.key_background_colorVKeyboard.key_background_downVKeyboard.key_background_normalVKeyboard.key_borderVKeyboard.key_disabled_background_normalVKeyboard.key_marginVKeyboard.layoutVKeyboard.layout_pathVKeyboard.margin_hintVKeyboard.on_touch_down()VKeyboard.on_touch_up()VKeyboard.refresh()VKeyboard.setup_mode()VKeyboard.setup_mode_dock()VKeyboard.setup_mode_free()VKeyboard.target
- Widget class
- Using Properties
- Basic drawing
- Widget touch event bubbling
- Usage of
Widget.center,Widget.right, andWidget.top WidgetWidget.add_widget()Widget.apply_class_lang_rules()Widget.canvasWidget.centerWidget.center_xWidget.center_yWidget.childrenWidget.clear_widgets()Widget.clsWidget.collide_point()Widget.collide_widget()Widget.disabledWidget.export_as_image()Widget.export_to_png()Widget.get_parent_window()Widget.get_root_window()Widget.get_window_matrix()Widget.heightWidget.idsWidget.motion_filterWidget.on_motion()Widget.on_touch_down()Widget.on_touch_move()Widget.on_touch_up()Widget.opacityWidget.parentWidget.posWidget.pos_hintWidget.proxy_refWidget.register_for_motion_event()Widget.remove_widget()Widget.rightWidget.sizeWidget.size_hintWidget.size_hint_maxWidget.size_hint_max_xWidget.size_hint_max_yWidget.size_hint_minWidget.size_hint_min_xWidget.size_hint_min_yWidget.size_hint_xWidget.size_hint_yWidget.to_local()Widget.to_parent()Widget.to_widget()Widget.to_window()Widget.topWidget.unregister_for_motion_event()Widget.walk()Widget.walk_reverse()Widget.widthWidget.xWidget.y
WidgetException