Skip to content

textual_enhanced.tools

Provides assorted tools that help with Textual things.

add_key

add_key(label, key, context=None)

Add a key name to a label.

Parameters:

Name Type Description Default

label

str

The label to add the key to.

required

key

str

The display name of the key to add.

required

context

App[Any] | Widget | None

The widget, screen or application.

None

Returns:

Type Description
str

The label with a display of the key added.

Notes

By default the key label will use the current theme's accent colour, if that can't be derived from the context them dim will be used.