mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Typing for label variants
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
"""Provides a simple Label widget."""
|
||||
|
||||
from typing import Literal
|
||||
|
||||
from rich.console import RenderableType
|
||||
|
||||
from textual.widgets._static import Static
|
||||
|
||||
LabelVariant = Literal["success", "error", "warning", "primary", "secondary", "accent"]
|
||||
|
||||
|
||||
class Label(Static):
|
||||
"""A simple label widget for displaying text-oriented renderables."""
|
||||
@@ -45,7 +49,7 @@ class Label(Static):
|
||||
self,
|
||||
renderable: RenderableType = "",
|
||||
*,
|
||||
variant: str | None = None,
|
||||
variant: LabelVariant | None = None,
|
||||
expand: bool = False,
|
||||
shrink: bool = False,
|
||||
markup: bool = True,
|
||||
|
||||
Reference in New Issue
Block a user