Allow icon in form input component
Misc style adjustments
This commit is contained in:
@@ -9,20 +9,25 @@ pub fn FormInput(
|
||||
#[props(default)] name: Option<String>,
|
||||
#[props(default)] required: bool,
|
||||
#[props(default)] r#type: String,
|
||||
children: Element,
|
||||
) -> Element {
|
||||
let name = name.unwrap_or(label.to_lowercase());
|
||||
|
||||
rsx! {
|
||||
div {
|
||||
class: "group",
|
||||
class: "group/field",
|
||||
|
||||
label {
|
||||
class: "label opacity-0 not-group-has-placeholder-shown:opacity-100 transition-opacity pl-2",
|
||||
p {
|
||||
class: "opacity-0 not-group-has-placeholder-shown/field:opacity-70 transition-opacity pl-2",
|
||||
{label.clone()}
|
||||
}
|
||||
|
||||
label {
|
||||
class: "input w-full",
|
||||
|
||||
{children}
|
||||
|
||||
input {
|
||||
class: "input",
|
||||
name,
|
||||
required,
|
||||
r#type,
|
||||
@@ -31,3 +36,4 @@ pub fn FormInput(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user