Allow icon in form input component

Misc style adjustments
This commit is contained in:
2026-07-08 20:44:38 -04:00
parent 4bacbfd1ab
commit e7c43e7a47

View File

@@ -9,24 +9,30 @@ pub fn FormInput(
#[props(default)] name: Option<String>, #[props(default)] name: Option<String>,
#[props(default)] required: bool, #[props(default)] required: bool,
#[props(default)] r#type: String, #[props(default)] r#type: String,
children: Element,
) -> Element { ) -> Element {
let name = name.unwrap_or(label.to_lowercase()); let name = name.unwrap_or(label.to_lowercase());
rsx! { rsx! {
div { div {
class: "group", class: "group/field",
label { p {
class: "label opacity-0 not-group-has-placeholder-shown:opacity-100 transition-opacity pl-2", class: "opacity-0 not-group-has-placeholder-shown/field:opacity-70 transition-opacity pl-2",
{label.clone()} {label.clone()}
} }
input { label {
class: "input", class: "input w-full",
name,
required, {children}
r#type,
placeholder: label, input {
name,
required,
r#type,
placeholder: label,
}
} }
} }
} }