pub struct HelperProps {
pub children: Children,
pub class: &'static str,
pub style: &'static str,
pub id: &'static str,
pub disabled: bool,
pub error: bool,
pub valid: bool,
pub filled: bool,
pub focused: bool,
pub margin: Margin,
pub data_testid: &'static str,
}lep only.Expand description
Props for the Helper component.
Renders accessible helper text beneath a form field.
When nested inside Control, it inherits error and disabled
from ControlContext. Error text uses role="alert" for immediate
screen-reader announcement.
ยงExamples
use form_rs::leptos::Helper;
use leptos::prelude::*;
#[component]
pub fn PasswordHint() -> impl IntoView {
view! {
<Helper id="pw-hint">"Must be at least 8 characters."</Helper>
}
}ยงRequired Props
- children:
Children- Helper text content.
ยงOptional Props
- class: [
&'static str]- Additional CSS class names on the
<p>.
- Additional CSS class names on the
- style: [
&'static str]- Inline CSS on the
<p>.
- Inline CSS on the
- id: [
&'static str]idattribute, use asaria-describedbyon the input.
- disabled:
bool- When
true, renders in disabled style.
- When
- error:
bool- When
true, renders in error color withrole="alert".
- When
- valid:
bool- When
true, renders in success color.
- When
- filled:
bool- When
true, applies the filled modifier.
- When
- focused:
bool- When
true, applies the focused modifier.
- When
- margin:
Margin- Vertical spacing adjustment.
- data_testid: [
&'static str]data-testidfor automated testing.
Fieldsยง
ยงchildren: ChildrenHelper text content.
class: &'static strAdditional CSS class names on the <p>.
style: &'static strInline CSS on the <p>.
id: &'static strid attribute, use as aria-describedby on the input.
disabled: boolWhen true, renders in disabled style.
error: boolWhen true, renders in error color with role="alert".
valid: boolWhen true, renders in success color.
filled: boolWhen true, applies the filled modifier.
focused: boolWhen true, applies the focused modifier.
margin: MarginVertical spacing adjustment.
data_testid: &'static strdata-testid for automated testing.
Implementationsยง
Sourceยงimpl HelperProps
impl HelperProps
Sourcepub fn builder() -> HelperPropsBuilder<((), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> HelperPropsBuilder<((), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building HelperProps.
On the builder, call .children(...), .class(...)(optional), .style(...)(optional), .id(...)(optional), .disabled(...)(optional), .error(...)(optional), .valid(...)(optional), .filled(...)(optional), .focused(...)(optional), .margin(...)(optional), .data_testid(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of HelperProps.
Trait Implementationsยง
Auto Trait Implementationsยง
impl !RefUnwindSafe for HelperProps
impl !Sync for HelperProps
impl !UnwindSafe for HelperProps
impl Freeze for HelperProps
impl Send for HelperProps
impl Unpin for HelperProps
impl UnsafeUnpin for HelperProps
Blanket Implementationsยง
impl<Token, Builder, How> AllPropsFor<Builder, How> for Tokenwhere
Builder: Buildable<Token>,
<Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> HasAllProps<(), T> for T
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 moreSourceยงimpl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Sourceยงfn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self to a value of a Properties struct.Sourceยงimpl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Sourceยงfn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self to a value of a Properties struct.