Skip to main content

Content

Trait Content 

Source
pub trait Content: ThemeExt {
    // Provided methods
    fn badge(&self, label: impl Into<SharedString>) -> Div { ... }
    fn badge_active(&self, label: impl Into<SharedString>) -> Div { ... }
    fn avatar(&self, initials: impl Into<SharedString>) -> Div { ... }
    fn tag(&self, label: impl Into<SharedString>) -> Div { ... }
    fn breadcrumb(&self) -> Div { ... }
    fn breadcrumb_item(
        &self,
        label: impl Into<SharedString>,
        current: bool,
    ) -> Div { ... }
    fn breadcrumb_separator(&self) -> Svg { ... }
    fn empty_state(
        &self,
        icon: impl Into<Icon>,
        title: impl Into<SharedString>,
        hint: impl Into<SharedString>,
    ) -> Div { ... }
}

Provided Methods§

Source

fn badge(&self, label: impl Into<SharedString>) -> Div

Right-anchored badge pill: rounded-full border px-2 py-0.5.

Source

fn badge_active(&self, label: impl Into<SharedString>) -> Div

Emerald status pill (the Accounts “Active” badge: bg-emerald-400/[0.12] text-emerald-300/90).

Source

fn avatar(&self, initials: impl Into<SharedString>) -> Div

Circular avatar holding one or two initials — the fallback every avatar needs, and often the whole thing on a monochrome surface.

Source

fn tag(&self, label: impl Into<SharedString>) -> Div

A removable chip — a token in a filter bar or a recipient field. The caller adds the click handler for the ✕.

Source

fn breadcrumb(&self) -> Div

Breadcrumb trail. Items are added by the caller with Self::breadcrumb_item, separated by Self::breadcrumb_separator.

Source

fn breadcrumb_item(&self, label: impl Into<SharedString>, current: bool) -> Div

One crumb. The last one is current and stops looking clickable.

Source

fn breadcrumb_separator(&self) -> Svg

The chevron between crumbs.

Source

fn empty_state( &self, icon: impl Into<Icon>, title: impl Into<SharedString>, hint: impl Into<SharedString>, ) -> Div

The centered “nothing here yet” panel: icon, headline, one line of hint.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Content for Theme

Implementors§