pub struct StatProps {
pub label: String,
pub value: String,
pub detail: String,
pub icon: Option<IconData>,
pub href: Option<String>,
pub attrs: Attributes,
}Expand description
One figure for a dashboard: what it counts, the value, and an optional line under it. With an
href the whole tile is a link, such as to the list the figure counts.
Lay several out in a grid of your own:
view! {
cx =>
<div class="grid gap-4 sm:grid-cols-2 xl:grid-cols-4">
stat(
label: "Posts",
value: "66",
detail: "65 drafts",
icon: icons::FILE_TEXT,
href: "/admin/posts".to_string(),
)
stat(label: "Comments", value: "4")
</div>
}Fields§
§label: StringWhat the value counts, e.g. "Posts".
value: StringThe figure, formatted, e.g. "1,204" or "98%".
detail: StringOptional muted line under the value, e.g. "12 this week".
icon: Option<IconData>Optional icon before the label.
href: Option<String>Optional URL the tile links to.
attrs: AttributesExtra attributes for the tile.
Implementations§
Source§impl StatProps
impl StatProps
Sourcepub fn builder() -> StatPropsBuilder<label, value>
pub fn builder() -> StatPropsBuilder<label, value>
Returns a StatPropsBuilder with no properties set.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for StatProps
impl !UnwindSafe for StatProps
impl Freeze for StatProps
impl Send for StatProps
impl Sync for StatProps
impl Unpin for StatProps
impl UnsafeUnpin for StatProps
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