@@ -76,6 +76,7 @@ class SwitchRoot(SwitchBaseComponent):
7676 cls ,
7777 * children ,
7878 name : Var [str ] | str | None = None ,
79+ value : Var [str ] | str | None = None ,
7980 default_checked : Var [bool ] | bool | None = None ,
8081 checked : Var [bool ] | bool | None = None ,
8182 native_button : Var [bool ] | bool | None = None ,
@@ -160,6 +161,7 @@ class HighLevelSwitch(SwitchRoot):
160161 cls ,
161162 * children ,
162163 name : Var [str ] | str | None = None ,
164+ value : Var [str ] | str | None = None ,
163165 default_checked : Var [bool ] | bool | None = None ,
164166 checked : Var [bool ] | bool | None = None ,
165167 native_button : Var [bool ] | bool | None = None ,
@@ -204,6 +206,7 @@ class HighLevelSwitch(SwitchRoot):
204206 Args:
205207 *children: Additional children to include in the switch.
206208 name: Identifies the field when a form is submitted.
209+ value: The value of the switch when it is checked. Used for form submission. Defaults to 'on'.
207210 default_checked: Whether the switch is initially active. To render a controlled switch, use the checked prop instead. Defaults to False.
208211 checked: Whether the switch is currently active. To render an uncontrolled switch, use the default_checked prop instead.
209212 on_checked_change: Event handler called when the switch is activated or deactivated.
@@ -236,6 +239,7 @@ class Switch(ComponentNamespace):
236239 def __call__ (
237240 * children ,
238241 name : Var [str ] | str | None = None ,
242+ value : Var [str ] | str | None = None ,
239243 default_checked : Var [bool ] | bool | None = None ,
240244 checked : Var [bool ] | bool | None = None ,
241245 native_button : Var [bool ] | bool | None = None ,
@@ -280,6 +284,7 @@ class Switch(ComponentNamespace):
280284 Args:
281285 *children: Additional children to include in the switch.
282286 name: Identifies the field when a form is submitted.
287+ value: The value of the switch when it is checked. Used for form submission. Defaults to 'on'.
283288 default_checked: Whether the switch is initially active. To render a controlled switch, use the checked prop instead. Defaults to False.
284289 checked: Whether the switch is currently active. To render an uncontrolled switch, use the default_checked prop instead.
285290 on_checked_change: Event handler called when the switch is activated or deactivated.
0 commit comments