pub struct ErrorStateProps<'__a> {
pub title: String,
pub detail: String,
pub action: Option<Child<'__a>>,
pub attrs: Attributes,
}Expand description
Renders a failed load inside the content region that failed.
Keeps detail generic: never renders error internals (driver messages, SQL, paths) into the
page.
let action = view! { cx => <a href=(list_url)>"Retry"</a> }.boxed();
Ok(view! { cx =>
error_state(
title: "Couldn't load Users",
detail: "Something went wrong while loading the records.",
action: Some(action.into()),
)
}.boxed())Fields§
§title: StringShort heading naming what failed, e.g. "Couldn't load Users".
detail: StringOptional muted detail line. Keep it generic — no error internals.
action: Option<Child<'__a>>Optional action under the text (e.g. a retry link). It inherits the
component’s action styling; pass a plain <a> (or button) without
your own color classes.
attrs: AttributesExtra attributes for the container. Add role="alert" here when the
region swaps in during a visit and the failure should be announced.
Implementations§
Source§impl<'__a> ErrorStateProps<'__a>
impl<'__a> ErrorStateProps<'__a>
Sourcepub fn builder() -> ErrorStatePropsBuilder<'__a, title>
pub fn builder() -> ErrorStatePropsBuilder<'__a, title>
Returns a ErrorStatePropsBuilder with no properties set.
Trait Implementations§
Auto Trait Implementations§
impl<'__a> !RefUnwindSafe for ErrorStateProps<'__a>
impl<'__a> !Sync for ErrorStateProps<'__a>
impl<'__a> !UnwindSafe for ErrorStateProps<'__a>
impl<'__a> Freeze for ErrorStateProps<'__a>
impl<'__a> Send for ErrorStateProps<'__a>
impl<'__a> Unpin for ErrorStateProps<'__a>
impl<'__a> UnsafeUnpin for ErrorStateProps<'__a>
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