Label
Bases: LocalizationMixin, TextSignalMixin, IconMixin, TTKWrapperBase, WidgetCapabilitiesMixin, TtkStateMixin, Label
bootstack wrapper for ttk.Label with bootstyle and icon support.
__init__
__init__(
master: Master = None, **kwargs: Unpack[LabelKwargs]
) -> None
Create a themed bootstack Label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
master
|
Master
|
Parent widget. If None, uses the default root window. |
None
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
text |
str
|
Text to display in the label. |
textvariable |
Variable
|
Tk variable linked to the label text. |
textsignal |
Signal[str]
|
Reactive Signal linked to the label text (auto-synced with textvariable). |
image |
PhotoImage
|
Image to display. |
icon |
str | dict
|
Theme-aware icon spec handled by the style system. |
icon_only |
bool
|
If True, removes the additional padding reserved for label text. |
compound |
str
|
Placement of the image relative to text. |
anchor |
str
|
Alignment of the label's content within its area. |
justify |
str
|
How to justify multiple lines of text. |
localize |
bool | Literal['auto']
|
Determines the widget's localization mode. |
value_format |
str | dict
|
Format specification for the label value. |
padding |
int | tuple
|
Extra space around the label content. |
width |
int
|
Width of the label in characters. |
wraplength |
int
|
Maximum width before wrapping text. |
font |
str | Font
|
Font for text. |
foreground |
str
|
Text color. |
background |
str
|
Background color. |
relief |
str
|
Border style. |
state |
str
|
Widget state. |
takefocus |
bool
|
Whether the widget participates in focus traversal. |
style |
str
|
Explicit ttk style name (overrides accent/variant). |
accent |
str
|
Accent token for styling, e.g. 'primary', 'danger', 'success'. |
variant |
str
|
Style variant, e.g. 'default', 'inverse'. |
bootstyle |
str
|
DEPRECATED - Use |
surface |
str
|
Optional surface token; otherwise inherited. |
style_options |
dict
|
Optional dict forwarded to the style builder. |