File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 22
33from typing import TYPE_CHECKING , ClassVar
44
5+ from rich .console import RenderableType
6+
57if TYPE_CHECKING :
68 from ..app import RenderResult
79from ..binding import Binding , BindingType
@@ -110,6 +112,7 @@ def __init__(
110112 id : str | None = None ,
111113 classes : str | None = None ,
112114 disabled : bool = False ,
115+ tooltip : RenderableType | None = None ,
113116 ):
114117 """Initialise the switch.
115118
@@ -120,12 +123,15 @@ def __init__(
120123 id: The ID of the switch in the DOM.
121124 classes: The CSS classes of the switch.
122125 disabled: Whether the switch is disabled or not.
126+ tooltip: Optional tooltip.
123127 """
124128 super ().__init__ (name = name , id = id , classes = classes , disabled = disabled )
125129 if value :
126130 self .slider_pos = 1.0
127131 self .set_reactive (Switch .value , value )
128132 self ._should_animate = animate
133+ if tooltip is not None :
134+ self .tooltip = tooltip
129135
130136 def watch_value (self , value : bool ) -> None :
131137 target_slider_pos = 1.0 if value else 0.0
You can’t perform that action at this time.
0 commit comments