Skip to main content

basecoat_core/props/
input.rs

1use crate::{AttrMap, BasecoatProps};
2use std::borrow::Cow;
3
4/// Input — maps to CSS class `.input`. No variants.
5#[derive(BasecoatProps, Default, Clone, Debug)]
6pub struct InputProps {
7    #[prop(optional, into)]
8    pub class: Option<Cow<'static, str>>,
9    /// HTML `type` attribute (text, email, password, etc.)
10    #[prop(optional, into)]
11    pub r#type: Option<Cow<'static, str>>,
12    #[prop(optional, into)]
13    pub placeholder: Option<Cow<'static, str>>,
14    #[prop(optional, into)]
15    pub value: Option<Cow<'static, str>>,
16    #[prop(default)]
17    pub disabled: bool,
18    #[prop(extend)]
19    pub attrs: AttrMap,
20}