diff --git a/thaw/src/switch/docs/mod.md b/thaw/src/switch/docs/mod.md index 3284877b..910f9faa 100644 --- a/thaw/src/switch/docs/mod.md +++ b/thaw/src/switch/docs/mod.md @@ -15,6 +15,7 @@ view! { | class | `MaybeProp` | `Default::default()` | | | id | `MaybeProp` | `Default::default()` | | | name | `MaybeProp` | `Default::default()` | A string specifying a name for the input control. This name is submitted along with the control's value when the form data is submitted. | +| value | `MaybeProp` | `Default::default()` | A string specifying the value for the input control. | | rules | `Vec` | `vec![]` | The rules to validate Field. | | checked | `Model` | `false` | Defines the controlled checked state of the Switch. | | label | `MaybeProp` | `Default::default()` | The Switch's label. | diff --git a/thaw/src/switch/mod.rs b/thaw/src/switch/mod.rs index 171011ea..e1f5b14f 100644 --- a/thaw/src/switch/mod.rs +++ b/thaw/src/switch/mod.rs @@ -11,6 +11,9 @@ pub fn Switch( /// This name is submitted along with the control's value when the form data is submitted. #[prop(optional, into)] name: MaybeProp, + /// A String specifying the value of the input control. + #[prop(optional, into)] + value: MaybeProp, /// The rules to validate Field. #[prop(optional, into)] rules: Vec, @@ -49,6 +52,7 @@ pub fn Switch( type="checkbox" id=id name=name + value=move || value.get() checked=checked.get_untracked() prop:checked=move || { checked.get() } node_ref=input_ref