pub struct Input { /* private fields */ }Expand description
Text input field styled like shadcn/ui
§Example
use armas_basic::components::Input;
let mut text = String::new();
let response = Input::new("Email")
.label("Email address")
.show(ui, &mut text);
if response.changed {
// text was modified
}Implementations§
Source§impl Input
impl Input
Sourcepub const fn variant(self, variant: InputVariant) -> Self
pub const fn variant(self, variant: InputVariant) -> Self
Set the variant (for backwards compatibility)
Sourcepub const fn state(self, state: InputState) -> Self
pub const fn state(self, state: InputState) -> Self
Set the validation state
Sourcepub fn description(self, text: impl Into<String>) -> Self
pub fn description(self, text: impl Into<String>) -> Self
Set description/helper text below the input
Sourcepub fn helper_text(self, text: impl Into<String>) -> Self
pub fn helper_text(self, text: impl Into<String>) -> Self
Alias for description (backwards compatibility)
Sourcepub fn right_icon(self, icon: impl Into<String>) -> Self
pub fn right_icon(self, icon: impl Into<String>) -> Self
Set right icon (emoji or character)
Sourcepub const fn height(self, height: f32) -> Self
pub const fn height(self, height: f32) -> Self
Set explicit height (overrides variant-based height)
Sourcepub const fn text_color(self, _color: Color32) -> Self
pub const fn text_color(self, _color: Color32) -> Self
Set text color (currently ignored - uses theme colors)
Sourcepub fn show(self, ui: &mut Ui, text: &mut String) -> InputResponse
pub fn show(self, ui: &mut Ui, text: &mut String) -> InputResponse
Show the input field
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnsafeUnpin for Input
impl UnwindSafe for Input
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more