textual.command
This module contains classes for working with Textual's command palette.
See the guide on the Command Palette for full details.
Hits
module-attribute
¶
Hits = AsyncIterator['DiscoveryHit | Hit']
Return type for the command provider's search method.
ProviderSource
module-attribute
¶
The type used to declare the providers for a CommandPalette.
Command
¶
Bases: Option
Class that holds a hit in the CommandList.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VisualType
|
The prompt for the option. |
required |
|
DiscoveryHit | Hit
|
The details of the hit associated with the option. |
required |
|
str | None
|
The optional ID for the option. |
None
|
|
bool
|
The initial enabled/disabled state. Enabled by default. |
False
|
CommandInput
¶
CommandList
¶
CommandPalette
¶
CommandPalette(
providers=None,
*,
placeholder="Search for commands…",
name=None,
id=None,
classes=None
)
Bases: SystemModalScreen[None]
The Textual command palette.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|