Skip to content

Commit 5f7e86d

Browse files
committed
closes #359
1 parent b10931f commit 5f7e86d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

thaw/src/input/docs/mod.md

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ view! {
125125
| Name | Type | Default | Description |
126126
| --- | --- | --- | --- |
127127
| class | `MaybeProp<String>` | `Default::default()` | |
128+
| style | `MaybeProp<String>` | `Default::default()` | |
128129
| id | `MaybeProp<String>` | `Default::default()` | |
129130
| name | `MaybeProp<String>` | `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. |
130131
| rules | `Vec<InputRule>` | `vec![]` | The rules to validate Field. |

thaw/src/input/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use thaw_utils::{
1414
#[component]
1515
pub fn Input(
1616
#[prop(optional, into)] class: MaybeProp<String>,
17+
#[prop(optional, into)] style: MaybeProp<String>,
1718
#[prop(optional, into)] id: MaybeProp<String>,
1819
/// A string specifying a name for the input control.
1920
/// This name is submitted along with the control's value when the form data is submitted.
@@ -62,6 +63,7 @@ pub fn Input(
6263
#[prop(optional, into)]
6364
size: Signal<InputSize>,
6465
) -> impl IntoView {
66+
let style = move || style.get().unwrap_or_default();
6567
mount_style("input", include_str!("./input.css"));
6668
let (id, name) = FieldInjection::use_id_and_name(id, name);
6769
let validate = Rule::validate(rules, value, name);
@@ -191,6 +193,7 @@ pub fn Input(
191193
size=input_size
192194
placeholder=move || placeholder.get()
193195
node_ref=input_ref
196+
style=style
194197
/>
195198

196199
{if let Some(suffix) = input_suffix.and_then(|suffix| suffix.if_.then_some(suffix)) {

0 commit comments

Comments
 (0)