pub struct InputOTPProps {
pub length: usize,
pub max_length: Option<usize>,
pub value: Option<String>,
pub default_value: Option<String>,
pub on_value_change: Option<EventHandler<String>>,
pub disabled: bool,
pub input_mode: InputOTPInputMode,
pub pattern: String,
pub input_class: Option<String>,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
}Expand description
Props for InputOTP.
Fields§
§length: usizeNumber of code characters and segments. Defaults to 6; 0 also means 6.
max_length: Option<usize>The maxlength of the real input. Defaults to length.
value: Option<String>Controlled code. Leave unset to let the field manage itself.
default_value: Option<String>Initial code when uncontrolled.
on_value_change: Option<EventHandler<String>>Called with the sanitized code after every edit or paste.
disabled: boolDisables the input and the segments.
input_mode: InputOTPInputModeThe virtual keyboard. Defaults to numeric, which also keeps codes to ASCII digits.
pattern: StringThe input’s pattern. Defaults to [0-9]*, which also keeps codes to ASCII digits.
input_class: Option<String>Extra classes for the real <input>.
class: Option<String>Extra classes for the root element, appended after the Lumen class.
attributes: Vec<Attribute>Any other <input> or global attribute for the real input, such as name, aria_label,
or aria_invalid: "true" (which also marks the segments invalid).
Implementations§
Source§impl InputOTPProps
impl InputOTPProps
Sourcepub fn builder() -> InputOTPPropsBuilder<((), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> InputOTPPropsBuilder<((), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building InputOTPProps.
On the builder, call .length(...)(optional), .max_length(...)(optional), .value(...)(optional), .default_value(...)(optional), .on_value_change(...)(optional), .disabled(...)(optional), .input_mode(...)(optional), .pattern(...)(optional), .input_class(...)(optional), .class(...)(optional), .attributes(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of InputOTPProps.
Trait Implementations§
Source§impl Clone for InputOTPProps
impl Clone for InputOTPProps
Source§impl PartialEq for InputOTPProps
impl PartialEq for InputOTPProps
Source§impl Properties for InputOTPPropswhere
Self: Clone,
impl Properties for InputOTPPropswhere
Self: Clone,
Source§type Builder = InputOTPPropsBuilder<((), (), (), (), (), (), (), (), (), (), ())>
type Builder = InputOTPPropsBuilder<((), (), (), (), (), (), (), (), (), (), ())>
Source§fn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
Source§fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for InputOTPProps
Auto Trait Implementations§
impl !RefUnwindSafe for InputOTPProps
impl !Send for InputOTPProps
impl !Sync for InputOTPProps
impl !UnwindSafe for InputOTPProps
impl Forget for InputOTPProps
impl Freeze for InputOTPProps
impl Move for InputOTPProps
impl Unpin for InputOTPProps
impl UnsafeUnpin for InputOTPPropswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'static UnsyncStorage: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
&'static Location<'static>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<String, ()>>>: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more