Theming¶
Prompts are styled with Rich themes.
When a prompt runs, any richer_prompt.* style defined in the console’s theme
overrides the default style; all other style names fall back to the defaults
listed below, no matter when the theme was created.
from rich.console import Console
from rich.style import Style
from rich.theme import Theme
from richer_prompt import MultiSelect
theme = Theme(
{
"richer_prompt.title": "", # or Style.null() for no style
"richer_prompt.cursor": "blue bold",
"richer_prompt.hint": Style(color="yellow", italic=True),
}
)
console = Console(theme=theme)
MultiSelect.ask(
"Select multiple options:",
choices=["Option 1", "Option 2", "Option 3"],
console=console
)
The following style names are available for customization:
Style name |
Default style |
Description |
|---|---|---|
|
|
Prompt title text. |
|
|
Prompt description text displayed under the title. |
|
|
Hint text shown at the bottom of prompts. |
|
null |
Base style for choice labels. |
|
|
Active cursor indicator for the current option. |
|
|
Style for selected choice labels or checkboxes. |
|
|
Style for choices marked as disabled (unselectable). |
|
null |
Base style for tab labels. |
|
|
Style for the currently active tab. |
|
|
Style for warning messages shown by prompts. |