pub struct CharacterCountProps {
pub max: u32,
pub value: String,
pub announce_at: Option<Vec<u32>>,
pub remaining_label: CharacterCountTemplate,
pub over_label: CharacterCountTemplate,
pub composing: bool,
pub value_id: Option<String>,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
}Expand description
Props for CharacterCount.
Fields§
§max: u32Maximum user-perceived characters, from 1 to one billion. Other values render no text. Input is never truncated; validate the limit in the form.
value: StringThe paired control’s current value. The counter cannot read other elements, so pass the
value the control’s oninput stores.
announce_at: Option<Vec<u32>>Remaining counts that announce politely while typing. Defaults to 20, 10, and 0.
remaining_label: CharacterCountTemplateText while within the limit. Defaults to {count} characters left (singular
{count} character left). A blank template falls back to the default.
over_label: CharacterCountTemplateText while over the limit. Defaults to {count} characters over the limit (singular
{count} character over the limit). A blank template falls back to the default.
composing: boolSet while the control is composing text with an input method; announcements wait until it ends.
value_id: Option<String>Id of the count text. Defaults to a generated id. Add it to the control’s
aria-describedby so assistive technology reads the count.
class: Option<String>Extra classes appended after the Lumen class.
attributes: Vec<Attribute>Any other <p> or global attribute.
Implementations§
Source§impl CharacterCountProps
impl CharacterCountProps
Sourcepub fn builder() -> CharacterCountPropsBuilder<((), (), (), (), (), (), (), (), ())>
pub fn builder() -> CharacterCountPropsBuilder<((), (), (), (), (), (), (), (), ())>
Create a builder for building CharacterCountProps.
On the builder, call .max(...), .value(...)(optional), .announce_at(...)(optional), .remaining_label(...)(optional), .over_label(...)(optional), .composing(...)(optional), .value_id(...)(optional), .class(...)(optional), .attributes(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of CharacterCountProps.
Trait Implementations§
Source§impl Clone for CharacterCountProps
impl Clone for CharacterCountProps
Source§impl PartialEq for CharacterCountProps
impl PartialEq for CharacterCountProps
Source§impl Properties for CharacterCountPropswhere
Self: Clone,
impl Properties for CharacterCountPropswhere
Self: Clone,
Source§type Builder = CharacterCountPropsBuilder<((), (), (), (), (), (), (), (), ())>
type Builder = CharacterCountPropsBuilder<((), (), (), (), (), (), (), (), ())>
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 CharacterCountProps
Auto Trait Implementations§
impl !RefUnwindSafe for CharacterCountProps
impl !Send for CharacterCountProps
impl !Sync for CharacterCountProps
impl !UnwindSafe for CharacterCountProps
impl Forget for CharacterCountProps
impl Freeze for CharacterCountPropswhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<u32>: Freeze,
PhantomData<Attribute>: Freeze,
impl Move for CharacterCountProps
impl Unpin for CharacterCountProps
impl UnsafeUnpin for CharacterCountPropswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<u32>: 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