Struct input_yew::Props

source ·
pub struct Props {
Show 22 fields pub input_type: Option<String>, pub label: String, pub name: String, pub icon: String, pub required: bool, pub input_ref: NodeRef, pub error_message: String, pub form_input_class: String, pub form_input_field_class: String, pub form_input_label_class: String, pub form_input_input_class: String, pub form_input_error_class: String, pub icon_class: String, pub input_handle: UseStateHandle<String>, pub input_valid_handle: UseStateHandle<bool>, pub validate_function: Callback<String, bool>, pub input_id: Option<String>, pub input_placeholder: Option<String>, pub aria_label: Option<String>, pub aria_required: Option<String>, pub aria_invalid: Option<String>, pub aria_describedby: Option<String>,
}
Expand description

Props for a custom input component.

Fields§

§input_type: Option<String>

The type of the input, e.g., “text”, “email”, “password”, etc.

§label: String

The label to be displayed for the input field.

§name: String

The name of the input field, used for form submission and accessibility.

§icon: String

The icon class to be used for displaying an icon alongside the input.

§required: bool

Indicates whether the input is required or not.

§input_ref: NodeRef

A reference to the DOM node of the input element.

§error_message: String

The error message to display when there is a validation error.

§form_input_class: String

The CSS class to be applied to all inner elements.

§form_input_field_class: String

The CSS class to be applied to the inner input element and icon.

§form_input_label_class: String

The CSS class to be applied to the label for the input element.

§form_input_input_class: String

The CSS class to be applied to the input element.

§form_input_error_class: String

The CSS class to be applied to the error div element.

§icon_class: String

The CSS class to be applied to the icon element.

§input_handle: UseStateHandle<String>

The state handle for managing the value of the input.

§input_valid_handle: UseStateHandle<bool>

The state handle for managing the validity state of the input.

§validate_function: Callback<String, bool>

A callback function to validate the input value. It takes a String as input and returns a bool.

§input_id: Option<String>

The ID attribute of the input element.

§input_placeholder: Option<String>

The placeholder text to be displayed in the input element.

§aria_label: Option<String>

The aria-label attribute for screen readers, providing a label for accessibility.

§aria_required: Option<String>

The aria-required attribute for screen readers, indicating whether the input is required.

§aria_invalid: Option<String>

The aria-invalid attribute for screen readers, indicating whether the input value is invalid.

§aria_describedby: Option<String>

The aria-describedby attribute for screen readers, describing the input element’s error message.

Trait Implementations§

source§

impl PartialEq<Props> for Props

source§

fn eq(&self, other: &Props) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Properties for Props

§

type Builder = PropsBuilder

Builder that will be used to construct properties
source§

fn builder() -> Self::Builder

Entrypoint for building properties
source§

impl StructuralPartialEq for Props

Auto Trait Implementations§

§

impl !RefUnwindSafe for Props

§

impl !Send for Props

§

impl !Sync for Props

§

impl Unpin for Props

§

impl !UnwindSafe for Props

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoPropValue<Option<T>> for T

source§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
source§

impl<T> IntoPropValue<T> for T

source§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> HasAllProps<(), T> for T