Skip to content

Footer

Added in version 0.63.0

This is a second iteration of the Footer. The version prior to 0.63.0 is available as ClassicFooter to help with backwards compatibility, but will be removed in v1.0.

A simple footer widget which is docked to the bottom of its parent container. Displays available keybindings for the currently focused widget.

  • Focusable
  • Container

Example

The example below shows an app with a single keybinding that contains only a Footer widget. Notice how the Footer automatically displays the keybinding.

FooterApp  q Quit the app  ? Show help screen  delete Delete the thing 

from textual.app import App, ComposeResult
from textual.binding import Binding
from textual.widgets import Footer


class FooterApp(App):
    BINDINGS = [
        Binding(key="q", action="quit", description="Quit the app"),
        Binding(
            key="question_mark",
            action="help",
            description="Show help screen",
            key_display="?",
        ),
        Binding(key="delete", action="delete", description="Delete the thing"),
        Binding(key="j", action="down", description="Scroll down", show=False),
    ]

    def compose(self) -> ComposeResult:
        yield Footer()


if __name__ == "__main__":
    app = FooterApp()
    app.run()

Reactive Attributes

Name Type Default Description
upper_case_keys bool False Display the keys in upper case.
ctrl_to_caret bool True Replace "ctrl+" with "^" to denote a key that requires holding ++CTRL++
compact bool False Display a more compact footer.

Messages

This widget posts no messages.

Bindings

This widget has no bindings.

Component Classes

This widget has no component classes.

Additional Notes

  • You can prevent keybindings from appearing in the footer by setting the show argument of the Binding to False.
  • You can customize the text that appears for the key itself in the footer using the key_display argument of Binding.

Bases: ScrollableContainer

Parameters:

Name Type Description Default

*children

Widget

Child widgets.

()

name

str | None

The name of the widget.

None

id

str | None

The ID of the widget in the DOM.

None

classes

str | None

The CSS classes for the widget.

None

disabled

bool

Whether the widget is disabled or not.

False

compact class-attribute instance-attribute

compact = reactive(False)

Display in compact style.

ctrl_to_caret class-attribute instance-attribute

ctrl_to_caret = reactive(True)

Convert 'ctrl+' prefix to '^'.

upper_case_keys class-attribute instance-attribute

upper_case_keys = reactive(False)

Upper case key display.