platform capa

platform-leptos-components

Reusable Leptos UI components shared by platform-staff-ui and platform-customer-ui (formerly primitives-staff-components per D-10D.1)

Reusable Leptos UI components shared by platform-staff-ui and platform-customer-ui (formerly primitives-staff-components per D-10D.1)

Tierplatform
Roleunclassified (baselined)
Pathcrates/platform/leptos-components
Edition2021
Targetsplatform_leptos_components
Public items159 across 25 modules
Tests69

What it is for

Reusable Leptos UI components for staff platform.

This crate provides a component library that can be used across different staff modules.

Sprint 10A (D-10A.1) merged in best-in-class patterns from rust-starters/leptos-staff-ui (rich_text_editor, file_upload, image_cropper), rust-inventory-ai/frontend (selection ctx, bulk_actions, view_toggle, context_menu), and rfpdb/crates/rfps-portal-shared (completion_banner). All consumer-domain coupling stripped at the source; these are now generic library crates.

Capabilities

account_hub (other)

AccountHub — the shared "My Account" screen (Sprint 0.99 Phase 1).

Item
pub const THEME_STORAGE_KEY: & str
fn apply_theme(theme : & str)
fn AccountHub(labels : AccountLabels, port : AccountPort) -> impl IntoView

AccountLabels

AccountHub — the shared "My Account" screen (Sprint 0.99 Phase 1).

Item
pub struct AccountLabels

AccountPort

AccountHub — the shared "My Account" screen (Sprint 0.99 Phase 1).

Item
pub struct AccountPort

AccountPreferences

AccountHub — the shared "My Account" screen (Sprint 0.99 Phase 1).

Item
pub struct AccountPreferences

AccountProfile

AccountHub — the shared "My Account" screen (Sprint 0.99 Phase 1).

Item
pub struct AccountProfile

ChangePassword

AccountHub — the shared "My Account" screen (Sprint 0.99 Phase 1).

Item
pub struct ChangePassword

LocaleOption

AccountHub — the shared "My Account" screen (Sprint 0.99 Phase 1).

Item
pub struct LocaleOption

PortFuture

AccountHub — the shared "My Account" screen (Sprint 0.99 Phase 1).

Item
pub type PortFuture<T>: Pin <Box <dyn Future <Output = Result <T, String>>>>

UpdateEmail

AccountHub — the shared "My Account" screen (Sprint 0.99 Phase 1).

Item
pub struct UpdateEmail

UpdatePreferences

AccountHub — the shared "My Account" screen (Sprint 0.99 Phase 1).

Item
pub struct UpdatePreferences

UpdateProfile

AccountHub — the shared "My Account" screen (Sprint 0.99 Phase 1).

Item
pub struct UpdateProfile

admin_shell (other)

Sidebar admin shell — generic chrome for staff/admin Leptos surfaces.

Item
fn route_matches_default(current : & str, href : & str, exact : bool) -> bool
fn NavGroup(# prop(into) label : String, children : Children) -> impl IntoView
fn TopBarHeader(children : ChildrenFn) -> impl IntoView
fn MobileMenuToggle() -> impl IntoView
fn SidebarShell(# prop(optional) brand : Option <ChildrenFn>, nav : ChildrenFn, # prop(optional) footer : Option <ChildrenFn>, children : Children,) -> impl IntoView

ActiveMatcher

Sidebar admin shell — generic chrome for staff/admin Leptos surfaces.

Item
pub type ActiveMatcher: Rc <dyn Fn(& str, & str) -> bool>
fn NavLink(# prop(into) href : String, # prop(optional) exact : bool, # prop(optional) predicate : Option <ActiveMatcher>, # prop(default = None) badge : Option <Signal <Option <i64>>>, # prop(default = None) icon_path : Option <String>, # doc = " Optional view-slot icon(Sprint 0.D #30 — closes the Sprint 0.9" # doc = " Gate 1.5 R2 Q2 deferred-View-slot debt). Use for multi-path SVGs," # doc = " icon-component libraries, or any markup beyond a single d-path" # doc = " attribute. Takes precedence over icon_path when both are set." # prop(default = None) icon : Option <Callback <(), View>>, children : Children,) -> impl IntoView

NavLinkSpec

Sidebar admin shell — generic chrome for staff/admin Leptos surfaces.

Item
pub struct NavLinkSpec
NavLinkSpec :: fn new(label : impl Into <String>, path : impl Into <String>) -> Self
NavLinkSpec :: fn with_icon(mut self, icon_path : impl Into <String>) -> Self
NavLinkSpec :: fn with_badge(mut self, badge : i64) -> Self
NavLinkSpec :: fn with_children(mut self, children : Vec <NavLinkSpec>) -> Self
NavLinkSpec :: fn exact(mut self) -> Self
fn render_nav_link_spec(spec : NavLinkSpec) -> impl IntoView

SidebarCtx

Sidebar admin shell — generic chrome for staff/admin Leptos surfaces.

Item
pub struct SidebarCtx

UserInfo

Sidebar admin shell — generic chrome for staff/admin Leptos surfaces.

Item
pub struct UserInfo
UserInfo :: fn new(name : impl Into <String>, email : impl Into <String>) -> Self
UserInfo :: fn with_avatar(mut self, url : impl Into <String>) -> Self
fn UserMenu(user : UserInfo, # prop(into, default = "/logout" . to_string()) signout_href : String,) -> impl IntoView
fn UserMenuDropdown(# prop(into) user : MaybeSignal <UserInfo>, # doc = " Target for the signout link rendered as <A href=...>. **Ignored" # doc = " when on_signout is Some —** in that case the entry becomes a" # doc = " <button> and the href is unused." # prop(into, default = "/logout" . to_string()) signout_href : String, # doc = " Optional callback invoked when the \"Sign out\" entry is clicked." # doc = " If provided, renders the entry as a <button> and overrides the" # doc = " signout_href link navigation — useful for async logout flows." # doc = " Added in Sprint 0.9.R. Backward-compat: None(default)" # doc = " preserves the Sprint 0.9.5 <A href> behavior." # prop(default = None) on_signout : Option <Callback <()>>, # doc = " Extra (label, href) links rendered between the user info header and" # doc = " \"Sign out\" -- e.g. Settings/Users/Roles/Access/API Keys/Logs, for a" # doc = " consumer that keeps administrative/setup pages out of the main" # doc = " sidebar(operator, sprint 3.69: \"the control panel on the left is" # doc = " super crammed, anything administrative or setup should be hidden" # doc = " with the dropdown on my account settings\"). Empty by default --" # doc = " existing consumers render exactly as before." # prop(default = Vec::new()) menu_items : Vec <(String, String)>,) -> impl IntoView

BadgeVariant

Badge component.

Item
pub enum BadgeVariant
fn Badge(# doc = " Badge variant" # prop(default = BadgeVariant::Default) variant : BadgeVariant, # doc = " Whether to render as a pill shape" # prop(default = false) pill : bool, # doc = " Additional CSS classes" # prop(default = "") class : & 'static str, # doc = " Badge content" children : Children,) -> impl IntoView
fn DotBadge(# doc = " Badge variant" # prop(default = BadgeVariant::Default) variant : BadgeVariant, # doc = " Whether to show pulsing animation" # prop(default = false) pulse : bool, # doc = " Badge label" children : Children,) -> impl IntoView

bulk_actions (other)

<BulkActionBar> — floating bottom-center action bar for bulk

Item
fn BulkActionBar(# doc = " Label for the selection count, e.g. \"item(s)\" or \"page(s)\" —" # doc = " the framework computes \"{N} {item_label} selected\"." # prop(into, default = "item(s)" . to_string()) item_label : String, # doc = " Consumer-supplied action affordances. Receives the current" # doc = " selection set so it can read the IDs for its mutation calls." # doc = " Typical contents: a <Button> per action, or a custom row" # doc = " of pickers + a \"Go\" button." children : ChildrenFn,) -> impl IntoView
fn make_selection_ctx(selected : ReadSignal <HashSet <Uuid>>, set_selected : WriteSignal <HashSet <Uuid>>,) -> SelectionCtx

ButtonVariant

Button component.

Item
pub enum ButtonVariant
fn Button(# doc = " Button variant" # prop(default = ButtonVariant::Primary) variant : ButtonVariant, # doc = " Click handler" # prop(optional) on_click : Option <Callback <ev::MouseEvent>>, # doc = " Disabled state(can be a plain bool or a reactive signal)" # prop(into, default = false . into()) disabled : MaybeSignal <bool>, # doc = " Loading state(shows spinner, can be a plain bool or a reactive signal)" # prop(into, default = false . into()) loading : MaybeSignal <bool>, # doc = " Button type(button, submit, reset)" # prop(default = "button") button_type : & 'static str, # doc = " Additional CSS classes" # prop(default = "") class : & 'static str, # doc = " Optional DOM id(e.g. a stable test/automation hook). Rendered only" # doc = " when non-empty." # prop(default = "") id : & 'static str, # doc = " Button content" children : Children,) -> impl IntoView
fn IconButton(# doc = " Button variant" # prop(default = ButtonVariant::Ghost) variant : ButtonVariant, # doc = " Click handler" # prop(optional) on_click : Option <Callback <ev::MouseEvent>>, # doc = " Disabled state" # prop(default = false) disabled : bool, # doc = " Aria label for accessibility" label : & 'static str, # doc = " Icon content" children : Children,) -> impl IntoView

CompletionItem

<CompletionBanner> — multi-step form / profile completion strip.

Item
pub struct CompletionItem
CompletionItem :: fn new(label : impl Into <String>, completed : bool) -> Self
fn CompletionBanner(# doc = " The full set of items the user is being asked to complete." items : Signal <Vec <CompletionItem>>, # doc = " Headline label(e.g. \"Complete your profile\")." # prop(into, default = "Complete your profile" . to_string()) title : String, # doc = " Optional href for the \"Continue setup →\" link." # prop(optional, into) continue_href : String, # doc = " Optional label for the continue link." # prop(into, default = "Continue setup →" . to_string()) continue_label : String,) -> impl IntoView

ContextMenuItem

<ContextMenu> — generic right-click / three-dot dropdown menu.

Item
pub enum ContextMenuItem
ContextMenuItem :: fn action(label : impl Into <String>, on_click : Callback <()>) -> Self
ContextMenuItem :: fn destructive(mut self) -> Self
ContextMenuItem :: fn with_icon(mut self, path : impl Into <String>) -> Self
ContextMenuItem :: fn with_dot_color(mut self, color : DotColor) -> Self
ContextMenuItem :: fn separator() -> Self
ContextMenuItem :: fn header(label : impl Into <String>) -> Self
ContextMenuItem :: fn scrollable_group(items : Vec <ContextMenuItem>, max_height : impl Into <String>) -> Self
fn ContextMenu(# doc = " Identifies the row this menu belongs to. Used by OpenMenuCtx" # doc = " for single-open enforcement." item_id : Uuid, # doc = " Menu contents." items : Vec <ContextMenuItem>, # doc = " CSS classes for trigger positioning." # prop(optional, into) trigger_class : String,) -> impl IntoView

DotColor

<ContextMenu> — generic right-click / three-dot dropdown menu.

Item
pub enum DotColor
DotColor :: fn bg_class(self) -> & 'static str

data_table (other)

Data table component.

Item
fn DataTable <T>(# doc = " Data items" items : Vec <T>, # doc = " Column definitions" columns : Vec <ColumnDef <T>>, # doc = " Whether data is loading" # prop(default = false) loading : bool, # doc = " Empty state message" # prop(default = "No items found") empty_message : & 'static str, # doc = " Row click handler" # prop(optional) on_row_click : Option <Callback <usize>>, # doc = " Key extractor for stable row identity" # prop(optional) key_fn : Option <KeyFn <T>>,) -> impl IntoView where T : Clone + 'static,

Column

Data table component.

Item
pub trait Column<T>

ColumnDef

Data table component.

Item
pub struct ColumnDef<T>

ColumnDef<T>

Data table component.

Item
ColumnDef<T> :: fn new(key : impl Into <String>, header : impl Into <String>, render : impl Fn(& T) -> View + 'static,) -> Self
ColumnDef<T> :: fn sortable(mut self) -> Self
ColumnDef<T> :: fn width(mut self, width : impl Into <String>) -> Self
ColumnDef<T> :: fn key(& self) -> & str
ColumnDef<T> :: fn header(& self) -> & str
ColumnDef<T> :: fn render(& self, item : & T) -> View
ColumnDef<T> :: fn sortable(& self) -> bool
ColumnDef<T> :: fn width(& self) -> Option <& str>

KeyFn

Data table component.

Item
pub type KeyFn<T>: Rc <dyn Fn(& T) -> String>

empty (other)

Empty state component.

Item
fn EmptyState(# doc = " Title" title : & 'static str, # doc = " Description" # prop(optional) description : Option <& 'static str>, # doc = " Icon(SVG path)" # prop(optional) icon : Option <& 'static str>, # doc = " Action button" # prop(optional) children : Option <Children>,) -> impl IntoView
fn ErrorState(# doc = " Error title" # prop(default = "Something went wrong") title : & 'static str, # doc = " Error message" message : String, # doc = " Retry handler" # prop(optional) on_retry : Option <Callback <()>>,) -> impl IntoView

UploadProgress

<FileUpload> — multipart-aware file picker with per-file progress.

Item
pub struct UploadProgress
fn FileUpload(# doc = " Endpoint URL for POST /api/v1/admin/media." # prop(into) upload_url : String, # doc = " CSRF cookie name(consumer's ApiClient knows this)." # prop(into) csrf_cookie_name : String, # doc = " MIME types passed to the <input accept> attribute." # prop(into, default = "image/*" . to_string()) accept : String, # doc = " Fires when one file's progress changes(loaded/total/percent)." # prop(into) on_progress : Callback <UploadProgress>, # doc = " Fires on a per-file 2xx with the parsed UploadResponse." # prop(into) on_complete : Callback <UploadResponse>, # doc = " Fires on a per-file 4xx/5xx with (filename, error_code, detail)." # prop(into) on_error : Callback <(String, String, String)>, # doc = " Allow multi-file picks(defaults to single)." # prop(default = false) multiple : bool,) -> impl IntoView

form (other)

Form components.

Item
fn FormGroup(# doc = " Label text" # prop(into) label : String, # doc = " Field name/id" name : & 'static str, # doc = " Whether the field is required" # prop(default = false) required : bool, # doc = " Error message" # prop(optional) error : Option <String>, # doc = " Hint text" # prop(optional, into) hint : Option <String>, # doc = " Form control" children : Children,) -> impl IntoView
fn TextInput(# doc = " Input name/id" name : & 'static str, # doc = " Input type(text, email, password, etc.)" # prop(default = "text") input_type : & 'static str, # doc = " Placeholder text" # prop(optional) placeholder : Option <& 'static str>, # doc = " Current value(controlled)" # prop(optional) value : Option <RwSignal <String>>, # doc = " Change handler(uncontrolled)" # prop(optional) on_input : Option <Callback <String>>, # doc = " Whether the field is disabled" # prop(default = false) disabled : bool, # doc = " Whether the field is readonly" # prop(default = false) readonly : bool, # doc = " Whether there's an error" # prop(default = false) has_error : bool, # doc = " Additional classes" # prop(default = "") class : & 'static str,) -> impl IntoView
fn TextArea(# doc = " Input name/id" name : & 'static str, # doc = " Placeholder text" # prop(optional) placeholder : Option <& 'static str>, # doc = " Number of rows" # prop(default = 4) rows : u32, # doc = " Current value(controlled)" # prop(optional) value : Option <RwSignal <String>>, # doc = " Change handler(uncontrolled)" # prop(optional) on_input : Option <Callback <String>>, # doc = " Whether the field is disabled" # prop(default = false) disabled : bool, # doc = " Whether there's an error" # prop(default = false) has_error : bool, # doc = " Additional classes" # prop(default = "") class : & 'static str,) -> impl IntoView
fn Checkbox(# doc = " Input name/id" name : & 'static str, # doc = " Label text" label : & 'static str, # doc = " Checked state(controlled)" # prop(optional) checked : Option <RwSignal <bool>>, # doc = " Change handler" # prop(optional) on_change : Option <Callback <bool>>, # doc = " Whether the field is disabled" # prop(default = false) disabled : bool,) -> impl IntoView

SelectOption

Form components.

Item
pub struct SelectOption
SelectOption :: fn new(value : impl Into <String>, label : impl Into <String>) -> Self
fn Select(# doc = " Input name/id" name : & 'static str, # doc = " Options" options : Vec <SelectOption>, # doc = " Current value(controlled)" # prop(optional) value : Option <RwSignal <String>>, # doc = " Change handler" # prop(optional) on_change : Option <Callback <String>>, # doc = " Whether the field is disabled" # prop(default = false) disabled : bool, # doc = " Placeholder option text" # prop(optional) placeholder : Option <& 'static str>, # doc = " Whether there's an error" # prop(default = false) has_error : bool,) -> impl IntoView

hierarchy_tree (other)

Hierarchy tree library crate — HierarchyNode<T> + build_hierarchy_tree +

Item
pub const MAX_HIERARCHY_DEPTH: usize

HierarchyNode

Hierarchy tree library crate — HierarchyNode<T> + build_hierarchy_tree +

Item
pub struct HierarchyNode<T : Clone + 'static>
fn build_hierarchy_tree <T, IdFn, LabelFn, ParentFn, CountFn>(flat : & T, id_fn : IdFn, label_fn : LabelFn, parent_fn : ParentFn, count_fn : CountFn,) -> Vec <HierarchyNode <T>> where T : Clone + 'static, IdFn : Fn(& T) -> String, LabelFn : Fn(& T) -> String, ParentFn : Fn(& T) -> Option <String>, CountFn : Fn(& T) -> Option <i64>,
`fn HierarchyTree <T>(nodes : Vec <HierarchyNode <T>>, # doc = " Signal pointing at the currently-active node id(for highlight)." # prop(into, default = Signal::derive(\

HierarchyNode<T>

Hierarchy tree library crate — HierarchyNode<T> + build_hierarchy_tree +

Item
HierarchyNode<T> :: fn new(id : impl Into <String>, label : impl Into <String>, payload : T) -> Self
HierarchyNode<T> :: fn with_count(mut self, count : i64) -> Self
HierarchyNode<T> :: fn with_children(mut self, children : Vec <HierarchyNode <T>>) -> Self

image_cropper (other)

<ImageCropper> — focal-point picker overlay.

Item
fn ImageCropper(# doc = " Absolute or root-relative URL to the image(typically the" # doc = " large-WebP variant of the asset)." # prop(into) src : String, # doc = " Initial focal point coordinates in [0, 1. Falls back to(0.5,"] # doc = " 0.5) when either is None." # prop(into, default = None) initial_focal_x : Option <f64>, # prop(into, default = None) initial_focal_y : Option <f64>, # doc = " Fires on every drag step with the new normalized coords." # prop(into) on_change : Callback <(f64, f64)>,) -> impl IntoView

loading (other)

Loading components.

Item
fn Spinner(# doc = " Size(sm, md, lg)" # prop(default = "md") size : & 'static str, # doc = " Color class" # prop(default = "text-blue-600") color : & 'static str,) -> impl IntoView
fn LoadingOverlay(# doc = " Whether loading is active" loading : ReadSignal <bool>, # doc = " Loading text" # prop(default = "Loading...") text : & 'static str, # doc = " Content to overlay" children : Children,) -> impl IntoView
fn PageLoading(# prop(default = "Loading...") text : & 'static str) -> impl IntoView
fn Skeleton(# doc = " Width class" # prop(default = "w-full") width : & 'static str, # doc = " Height class" # prop(default = "h-4") height : & 'static str,) -> impl IntoView
fn SkeletonCard() -> impl IntoView
fn SkeletonTableRow(# prop(default = 4) columns : usize) -> impl IntoView

media (other)

Media chrome library crates — <DropZone> + <MediaGrid> + MediaItem.

Item
fn format_file_size(bytes : i64) -> String
fn is_image(content_type : & str) -> bool
fn DropZone(# doc = " Fires when the user drops files OR picks files via the click input." # doc = " Both paths normalize to a FileList." # prop(into) on_files : Callback <FileList>, # doc = " Reactive uploading indicator — when true, the drop zone shows a" # doc = " spinner overlay instead of the upload prompt." # prop(into, default = MaybeSignal::Static(false)) uploading : MaybeSignal <bool>, # doc = " accept attribute passed to the file input. Defaults to images." # prop(into, default = "image/*" . to_string()) accept : String, # doc = " Help-text shown under the upload prompt." # prop(into, default = "PNG, JPG, PDF up to 10MB" . to_string()) hint : String,) -> impl IntoView

MediaItem

Media chrome library crates — <DropZone> + <MediaGrid> + MediaItem.

Item
pub struct MediaItem
MediaItem :: fn new(id : Uuid, filename : impl Into <String>, url : impl Into <String>) -> Self
MediaItem :: fn with_content_type(mut self, ct : impl Into <String>) -> Self
MediaItem :: fn with_size_bytes(mut self, n : i64) -> Self
fn MediaGrid(# prop(into) items : Signal <Vec <MediaItem>>, # doc = " Optional delete action. When Some, hover overlay shows a delete" # doc = " button that calls this with the item id." # prop(default = None) on_delete : Option <Callback <Uuid>>, # doc = " Optional view action. When Some, hover overlay shows a view" # doc = " button that calls this with the item id. Consumer decides what" # doc = " view means(modal, new tab, route transition, etc.)." # prop(default = None) on_view : Option <Callback <Uuid>>,) -> impl IntoView

MediaPickerItem

Media picker modal library crate (Sprint 0.33) — <MediaPicker>.

Item
pub struct MediaPickerItem
MediaPickerItem :: fn new(id : impl Into <String>, thumbnail_url : impl Into <String>, filename : impl Into <String>,) -> Self
fn MediaPicker(# doc = " Whether the picker is open." open : ReadSignal <bool>, # doc = " Assets to choose from(consumer fetches/filters these)." items : Signal <Vec <MediaPickerItem>>, # doc = " Called with the chosen asset id." on_select : Callback <String>, # doc = " Called when the picker is dismissed." on_close : Callback <()>, # doc = " Optional search callback — when Some, a search box is shown and fires" # doc = " this with the query on input." # prop(default = None) on_search : Option <Callback <String>>, # doc = " Optional load-more callback — when Some, a \"Load more\" button is shown." # prop(default = None) on_load_more : Option <Callback <()>>,) -> impl IntoView

modal (other)

Modal dialog component.

Item
fn Modal(# doc = " Whether the modal is open" open : ReadSignal <bool>, # doc = " Close handler" on_close : Callback <()>, # doc = " Modal title. String, not &'static str: a translated title comes out" # doc = " of the i18n catalog at render time and cannot be a literal(staff-ui's" # doc = " no-unwrapped-literal gate would otherwise force every caller to ship an" # doc = " English title). #[prop(into) keeps title=\"Literal\" call sites"] # doc = " working unchanged." # prop(into) title : String, # doc = " Modal size" # prop(default = "md") size : & 'static str, # doc = " Whether clicking backdrop closes the modal" # prop(default = true) close_on_backdrop : bool, # doc = " Modal content" children : ChildrenFn,) -> impl IntoView
fn ConfirmModal(# doc = " Whether the modal is open" open : ReadSignal <bool>, # doc = " Close handler" on_close : Callback <()>, # doc = " Confirm handler" on_confirm : Callback <()>, # doc = " Modal title — see [Modal's title for why this is a String."] # prop(into) title : String, # doc = " Confirmation message" message : String, # doc = " Confirm button text" # prop(default = "Confirm") confirm_text : & 'static str, # doc = " Cancel button text" # prop(default = "Cancel") cancel_text : & 'static str, # doc = " Whether the action is destructive" # prop(default = false) destructive : bool, # doc = " Optional DOM id for the confirm button(a stable test/automation" # doc = " hook). Rendered only when non-empty; needed when more than one" # doc = " ConfirmModal can be mounted at once(distinct ids per instance)." # prop(default = "") confirm_id : & 'static str,) -> impl IntoView

pagination (other)

Pagination component.

Item
fn Pagination(# doc = " Current page(1-indexed)" current_page : ReadSignal <u32>, # doc = " Total number of pages" total_pages : ReadSignal <u32>, # doc = " Page change handler" on_page_change : Callback <u32>, # doc = " Number of page buttons to show" # prop(default = 5) visible_pages : usize,) -> impl IntoView
fn PageSizeSelector(# doc = " Current page size" page_size : ReadSignal <u32>, # doc = " Page size change handler" on_change : Callback <u32>, # doc = " Available page sizes" # prop(default = vec ! [10, 25, 50, 100)] options : Vec <u32>,) -> impl IntoView
fn PaginationInfo(# doc = " Current page(1-indexed)" current_page : ReadSignal <u32>, # doc = " Page size" page_size : ReadSignal <u32>, # doc = " Total items" total_items : ReadSignal <u32>,) -> impl IntoView

GalleryPhoto

Photo gallery library crate — GalleryPhoto + <PhotoGallery>.

Item
pub struct GalleryPhoto
GalleryPhoto :: fn new(id : Uuid, url : impl Into <String>) -> Self
GalleryPhoto :: fn primary(mut self) -> Self
fn sort_primary_first(photos : & mut GalleryPhoto)
fn PhotoGallery(photos : Vec <GalleryPhoto>, # doc = " Optional \"Make Primary\" callback. When Some and the thumb is not" # doc = " already first, hover overlay shows a ⬆ button that calls this with" # doc = " the photo id." # prop(default = None) on_set_primary : Option <Callback <Uuid>>, # doc = " Optional \"Delete\" callback. When Some, hover overlay shows a ✕" # doc = " button that calls this with the photo id." # prop(default = None) on_delete : Option <Callback <Uuid>>, # doc = " When true, action buttons are always visible(touch / a11y" # doc = " consumers). Default false preserves the donor's" # doc = " hover-only behavior." # prop(default = false) actions_always_visible : bool, # doc = " Optional empty-state slot. When Some, called once when photos" # doc = " is empty and the return value replaces the default placeholder" # doc = " SVG." # prop(default = None) empty_view : Option <Callback <(), View>>,) -> impl IntoView

PictureSource

Responsive <Picture> library crate (Sprint 0.29).

Item
pub struct PictureSource
PictureSource :: fn new(webp_url : impl Into <String>, jpeg_url : impl Into <String>, alt : impl Into <String>,) -> Self
PictureSource :: fn with_dimensions(mut self, width : u32, height : u32) -> Self
fn Picture(# doc = " The WebP + JPEG source pair." source : PictureSource, # doc = " loading=\"lazy\"(default) vs \"eager\"(e.g. above-the-fold hero)." # prop(default = true) lazy : bool, # doc = " Extra classes applied to the <img>." # prop(into, optional) class : String,) -> impl IntoView

rich_text_editor (other)

<RichTextEditor> — markdown source + live preview pane.

Item
fn RichTextEditor(# doc = " Initial markdown source." # prop(into) initial : String, # doc = " Fires on every keystroke with the current markdown source." # doc = " The host page reads this in its Save handler." # prop(into) on_change : Callback <String>, # doc = " Optional server-verified body_html(fetched + passed by the" # doc = " host page via a markdown-preview endpoint). When present," # doc = " replaces the local pulldown-cmark preview and shows the" # doc = " \"verified\" badge." # prop(into, default = create_rw_signal(None)) server_preview : RwSignal <Option <String>>,) -> impl IntoView

selection (other)

Cross-component selection + actions context.

Item
fn SelectionCheckbox(item_id : Uuid, # prop(optional, into) class : String) -> impl IntoView
fn has_selection_ctx() -> bool

ActionKind

Cross-component selection + actions context.

Item
pub enum ActionKind

ConfirmCtx

Cross-component selection + actions context.

Item
pub struct ConfirmCtx

ItemActionsCtx

Cross-component selection + actions context.

Item
pub struct ItemActionsCtx

OpenMenuCtx

Cross-component selection + actions context.

Item
pub struct OpenMenuCtx

PendingAction

Cross-component selection + actions context.

Item
pub struct PendingAction

SelectionCtx

Cross-component selection + actions context.

Item
pub struct SelectionCtx

toast (other)

Toast notification system.

Item
fn ToastProvider(children : Children) -> impl IntoView

ToastContext

Toast notification system.

Item
pub struct ToastContext
ToastContext :: fn new() -> Self
ToastContext :: fn show(& self, toast : ToastMessage)
ToastContext :: fn success(& self, title : impl Into <String>)
ToastContext :: fn error(& self, title : impl Into <String>)
ToastContext :: fn warning(& self, title : impl Into <String>)
ToastContext :: fn info(& self, title : impl Into <String>)
ToastContext :: fn dismiss(& self, id : & str)
ToastContext :: fn default() -> Self
fn use_toasts() -> ToastContext

ToastMessage

Toast notification system.

Item
pub struct ToastMessage
ToastMessage :: fn new(toast_type : ToastType, title : impl Into <String>) -> Self
ToastMessage :: fn with_message(mut self, message : impl Into <String>) -> Self
ToastMessage :: fn with_duration(mut self, duration_ms : u64) -> Self
ToastMessage :: fn success(title : impl Into <String>) -> Self
ToastMessage :: fn error(title : impl Into <String>) -> Self
ToastMessage :: fn warning(title : impl Into <String>) -> Self
ToastMessage :: fn info(title : impl Into <String>) -> Self
fn Toast(toast : ToastMessage, on_dismiss : Callback <String>) -> impl IntoView
fn ToastContainer(toasts : RwSignal <VecDeque <ToastMessage>>) -> impl IntoView

ToastType

Toast notification system.

Item
pub enum ToastType

typeahead_selector (other)

Typeahead hierarchy selector — TypeaheadEntry + build_breadcrumb_entries

Item
pub const MAX_BREADCRUMB_DEPTH: usize
pub const MAX_TYPEAHEAD_RESULTS: usize

TypeaheadEntry

Typeahead hierarchy selector — TypeaheadEntry + build_breadcrumb_entries

Item
pub struct TypeaheadEntry
TypeaheadEntry :: fn new(id : Uuid, label : impl Into <String>, breadcrumb : impl Into <String>) -> Self
TypeaheadEntry :: fn with_badge(mut self, badge : impl Into <String>) -> Self
fn build_breadcrumb_entries <T, IdFn, LabelFn, ParentFn, BadgeFn>(flat : & T, id_fn : IdFn, label_fn : LabelFn, parent_fn : ParentFn, badge_fn : BadgeFn,) -> Vec <TypeaheadEntry> where IdFn : Fn(& T) -> Uuid, LabelFn : Fn(& T) -> String, ParentFn : Fn(& T) -> Option <Uuid>, BadgeFn : Fn(& T) -> Option <String>,
fn filter_and_rank(entries : & TypeaheadEntry, query : & str) -> Vec <TypeaheadEntry>
fn TypeaheadHierarchySelector(# doc = " Reactive list of available entries(consumer fetches + builds)." # prop(into) entries : Signal <Vec <TypeaheadEntry>>, # doc = " Currently selected entry id(None = no selection)." # prop(into) selected : Signal <Option <Uuid>>, # doc = " Fires when the user selects an entry(Some(id)) or clears the" # doc = " chip(None). Consumer mirrors to its own state via this." on_select : Callback <Option <Uuid>>, # doc = " Placeholder shown in the search input when no entry is selected." # prop(into, default = "Search…" . to_string()) placeholder : String,) -> impl IntoView

view_toggle (other)

<ViewToggle> — three-mode list/grid/card switcher with

Item
fn load_view_mode(key : & str) -> ViewMode
fn save_view_mode(key : & str, mode : ViewMode)
fn ViewToggle(mode : ReadSignal <ViewMode>, set_mode : WriteSignal <ViewMode>, # prop(into) storage_key : String,) -> impl IntoView

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

platform_leptos_components

flowchart TD
  n_platform_leptos_components["platform_leptos_components"]
  n_platform_leptos_components --> n_account_hub["account_hub"]
  n_platform_leptos_components --> n_admin_shell["admin_shell"]
  n_platform_leptos_components --> n_badge["badge"]
  n_platform_leptos_components --> n_bulk_actions["bulk_actions"]
  n_platform_leptos_components --> n_button["button"]
  n_platform_leptos_components --> n_completion_banner["completion_banner"]
  n_platform_leptos_components --> n_context_menu["context_menu"]
  n_platform_leptos_components --> n_data_table["data_table"]
  n_platform_leptos_components --> n_empty["empty"]
  n_platform_leptos_components --> n_file_upload["file_upload"]
  n_platform_leptos_components --> n_form["form"]
  n_platform_leptos_components --> n_hierarchy_tree["hierarchy_tree"]
  n_platform_leptos_components --> n_image_cropper["image_cropper"]
  n_platform_leptos_components --> n_loading["loading"]
  n_platform_leptos_components --> n_media["media"]
  n_platform_leptos_components --> n_media_picker["media_picker"]
  n_platform_leptos_components --> n_modal["modal"]
  n_platform_leptos_components --> n_pagination["pagination"]
  n_platform_leptos_components --> n_photo_gallery["photo_gallery"]
  n_platform_leptos_components --> n_picture["picture"]
  n_platform_leptos_components --> n_rich_text_editor["rich_text_editor"]
  n_platform_leptos_components --> n_selection["selection"]
  n_platform_leptos_components --> n_toast["toast"]
  n_platform_leptos_components --> n_typeahead_selector["typeahead_selector"]
  n_platform_leptos_components --> n_view_toggle["view_toggle"]

Public surface

`account_hub`

ItemWhat it is
pub const THEME_STORAGE_KEY: & strlocalStorage key the anti-FOUC <head> script and this component agree on
pub type PortFuture<T>: Pin <Box <dyn Future <Output = Result <T, String>>>>A boxed, single-threaded async result — the wire shape for AccountPort closures
pub struct AccountProfileRead model for GET /me/profile.
pub struct UpdateProfilePATCH body for /me/profile
pub struct ChangePasswordPOST body for /me/change_password.
pub struct UpdateEmailPATCH body for /me/email
pub struct AccountPreferencesRead model for GET /me/preferences (UserPreferences).
pub struct UpdatePreferencesPATCH body for /me/preferences
pub struct LocaleOptionA selectable locale option (value = BCP-47 tag, label = endonym).
pub struct AccountLabelsEvery user-facing string the hub renders
pub struct AccountPortThe host-supplied networking surface
fn apply_theme(theme : & str)Apply a theme to the document: toggles the .dark class on <html> and mirrors the choice into localStorage so the anti-FOUC <head> script re-applies it on the next load before WASM mounts
fn AccountHub(labels : AccountLabels, port : AccountPort) -> impl IntoViewThe shared My Account hub

`admin_shell`

ItemWhat it is
pub struct NavLinkSpecSerializable nav-link descriptor for registry-style or server-driven nav configuration
NavLinkSpec :: fn new(label : impl Into <String>, path : impl Into <String>) -> Self
NavLinkSpec :: fn with_icon(mut self, icon_path : impl Into <String>) -> Self
NavLinkSpec :: fn with_badge(mut self, badge : i64) -> Self
NavLinkSpec :: fn with_children(mut self, children : Vec <NavLinkSpec>) -> Self
NavLinkSpec :: fn exact(mut self) -> SelfMark this spec as exact-match (landing-page semantics).
pub struct UserInfoUser identity for the <UserMenu> component.
UserInfo :: fn new(name : impl Into <String>, email : impl Into <String>) -> Self
UserInfo :: fn with_avatar(mut self, url : impl Into <String>) -> Self
fn route_matches_default(current : & str, href : & str, exact : bool) -> boolDefault active-route matcher
pub type ActiveMatcher: Rc <dyn Fn(& str, & str) -> bool>Override predicate type for the <NavLink> predicate prop
pub struct SidebarCtxShared context provided by <SidebarShell>
fn NavLink(# prop(into) href : String, # prop(optional) exact : bool, # prop(optional) predicate : Option <ActiveMatcher>, # prop(default = None) badge : Option <Signal <Option <i64>>>, # prop(default = None) icon_path : Option <String>, # doc = " Optional view-slot icon(Sprint 0.D #30 — closes the Sprint 0.9" # doc = " Gate 1.5 R2 Q2 deferred-View-slot debt). Use for multi-path SVGs," # doc = " icon-component libraries, or any markup beyond a single d-path" # doc = " attribute. Takes precedence over icon_path when both are set." # prop(default = None) icon : Option <Callback <(), View>>, children : Children,) -> impl IntoViewSingle nav link with active-state styling and optional reactive badge
fn render_nav_link_spec(spec : NavLinkSpec) -> impl IntoViewRender a NavLinkSpec (data-layer) as a <NavLink> (UI layer)
fn NavGroup(# prop(into) label : String, children : Children) -> impl IntoViewOptional section grouping with a label header
fn UserMenu(user : UserInfo, # prop(into, default = "/logout" . to_string()) signout_href : String,) -> impl IntoViewPlacement-neutral user menu
fn TopBarHeader(children : ChildrenFn) -> impl IntoViewSticky top-bar chrome
fn UserMenuDropdown(# prop(into) user : MaybeSignal <UserInfo>, # doc = " Target for the signout link rendered as <A href=...>. **Ignored" # doc = " when on_signout is Some —** in that case the entry becomes a" # doc = " <button> and the href is unused." # prop(into, default = "/logout" . to_string()) signout_href : String, # doc = " Optional callback invoked when the \"Sign out\" entry is clicked." # doc = " If provided, renders the entry as a <button> and overrides the" # doc = " signout_href link navigation — useful for async logout flows." # doc = " Added in Sprint 0.9.R. Backward-compat: None(default)" # doc = " preserves the Sprint 0.9.5 <A href> behavior." # prop(default = None) on_signout : Option <Callback <()>>, # doc = " Extra (label, href) links rendered between the user info header and" # doc = " \"Sign out\" -- e.g. Settings/Users/Roles/Access/API Keys/Logs, for a" # doc = " consumer that keeps administrative/setup pages out of the main" # doc = " sidebar(operator, sprint 3.69: \"the control panel on the left is" # doc = " super crammed, anything administrative or setup should be hidden" # doc = " with the dropdown on my account settings\"). Empty by default --" # doc = " existing consumers render exactly as before." # prop(default = Vec::new()) menu_items : Vec <(String, String)>,) -> impl IntoViewClick-to-open user-menu dropdown for header-bar placement
fn MobileMenuToggle() -> impl IntoViewCompanion hamburger toggle for the mobile drawer
fn SidebarShell(# prop(optional) brand : Option <ChildrenFn>, nav : ChildrenFn, # prop(optional) footer : Option <ChildrenFn>, children : Children,) -> impl IntoViewSidebar shell — desktop sidebar + mobile slide-out drawer + main content

`badge`

ItemWhat it is
pub enum BadgeVariantBadge variant for different styles.
fn Badge(# doc = " Badge variant" # prop(default = BadgeVariant::Default) variant : BadgeVariant, # doc = " Whether to render as a pill shape" # prop(default = false) pill : bool, # doc = " Additional CSS classes" # prop(default = "") class : & 'static str, # doc = " Badge content" children : Children,) -> impl IntoViewBadge component for displaying status or labels.
fn DotBadge(# doc = " Badge variant" # prop(default = BadgeVariant::Default) variant : BadgeVariant, # doc = " Whether to show pulsing animation" # prop(default = false) pulse : bool, # doc = " Badge label" children : Children,) -> impl IntoViewDot badge for simple status indicators.

`bulk_actions`

ItemWhat it is
fn BulkActionBar(# doc = " Label for the selection count, e.g. \"item(s)\" or \"page(s)\" —" # doc = " the framework computes \"{N} {item_label} selected\"." # prop(into, default = "item(s)" . to_string()) item_label : String, # doc = " Consumer-supplied action affordances. Receives the current" # doc = " selection set so it can read the IDs for its mutation calls." # doc = " Typical contents: a <Button> per action, or a custom row" # doc = " of pickers + a \"Go\" button." children : ChildrenFn,) -> impl IntoView
fn make_selection_ctx(selected : ReadSignal <HashSet <Uuid>>, set_selected : WriteSignal <HashSet <Uuid>>,) -> SelectionCtxHelper to build a SelectionCtx from a page-local signal pair

`button`

ItemWhat it is
pub enum ButtonVariantButton variants for different styles.
fn Button(# doc = " Button variant" # prop(default = ButtonVariant::Primary) variant : ButtonVariant, # doc = " Click handler" # prop(optional) on_click : Option <Callback <ev::MouseEvent>>, # doc = " Disabled state(can be a plain bool or a reactive signal)" # prop(into, default = false . into()) disabled : MaybeSignal <bool>, # doc = " Loading state(shows spinner, can be a plain bool or a reactive signal)" # prop(into, default = false . into()) loading : MaybeSignal <bool>, # doc = " Button type(button, submit, reset)" # prop(default = "button") button_type : & 'static str, # doc = " Additional CSS classes" # prop(default = "") class : & 'static str, # doc = " Optional DOM id(e.g. a stable test/automation hook). Rendered only" # doc = " when non-empty." # prop(default = "") id : & 'static str, # doc = " Button content" children : Children,) -> impl IntoViewButton component.
fn IconButton(# doc = " Button variant" # prop(default = ButtonVariant::Ghost) variant : ButtonVariant, # doc = " Click handler" # prop(optional) on_click : Option <Callback <ev::MouseEvent>>, # doc = " Disabled state" # prop(default = false) disabled : bool, # doc = " Aria label for accessibility" label : & 'static str, # doc = " Icon content" children : Children,) -> impl IntoViewIcon button (circular, icon only).

`completion_banner`

ItemWhat it is
pub struct CompletionItem
CompletionItem :: fn new(label : impl Into <String>, completed : bool) -> Self
fn CompletionBanner(# doc = " The full set of items the user is being asked to complete." items : Signal <Vec <CompletionItem>>, # doc = " Headline label(e.g. \"Complete your profile\")." # prop(into, default = "Complete your profile" . to_string()) title : String, # doc = " Optional href for the \"Continue setup →\" link." # prop(optional, into) continue_href : String, # doc = " Optional label for the continue link." # prop(into, default = "Continue setup →" . to_string()) continue_label : String,) -> impl IntoView

`context_menu`

ItemWhat it is
pub enum DotColorColor palette for dot indicators on menu actions
DotColor :: fn bg_class(self) -> & 'static strTailwind background-color class for the dot.
pub enum ContextMenuItem
ContextMenuItem :: fn action(label : impl Into <String>, on_click : Callback <()>) -> Self
ContextMenuItem :: fn destructive(mut self) -> Self
ContextMenuItem :: fn with_icon(mut self, path : impl Into <String>) -> Self
ContextMenuItem :: fn with_dot_color(mut self, color : DotColor) -> SelfSprint 0.8: attach a colored dot indicator to an action item (renders as a small circle to the left of the icon/label).
ContextMenuItem :: fn separator() -> Self
ContextMenuItem :: fn header(label : impl Into <String>) -> SelfSprint 0.8: uppercase section label between item groups.
ContextMenuItem :: fn scrollable_group(items : Vec <ContextMenuItem>, max_height : impl Into <String>) -> SelfSprint 0.8: wrap a subgroup of items in a max-height scroll container
fn ContextMenu(# doc = " Identifies the row this menu belongs to. Used by OpenMenuCtx" # doc = " for single-open enforcement." item_id : Uuid, # doc = " Menu contents." items : Vec <ContextMenuItem>, # doc = " CSS classes for trigger positioning." # prop(optional, into) trigger_class : String,) -> impl IntoViewThree-dot trigger button + dropdown overlay

`data_table`

ItemWhat it is
pub type KeyFn<T>: Rc <dyn Fn(& T) -> String>Sprint 0.8 drive-by clippy fix (type_complexity): named alias for the stable-key extractor closure used by DataTable.
pub struct ColumnDef<T>Column definition for the data table.
ColumnDef<T> :: fn new(key : impl Into <String>, header : impl Into <String>, render : impl Fn(& T) -> View + 'static,) -> Self
ColumnDef<T> :: fn sortable(mut self) -> Self
ColumnDef<T> :: fn width(mut self, width : impl Into <String>) -> Self
pub trait Column<T>Column trait for type-erased column handling.
ColumnDef<T> :: fn key(& self) -> & str
ColumnDef<T> :: fn header(& self) -> & str
ColumnDef<T> :: fn render(& self, item : & T) -> View
ColumnDef<T> :: fn sortable(& self) -> bool
ColumnDef<T> :: fn width(& self) -> Option <& str>
fn DataTable <T>(# doc = " Data items" items : Vec <T>, # doc = " Column definitions" columns : Vec <ColumnDef <T>>, # doc = " Whether data is loading" # prop(default = false) loading : bool, # doc = " Empty state message" # prop(default = "No items found") empty_message : & 'static str, # doc = " Row click handler" # prop(optional) on_row_click : Option <Callback <usize>>, # doc = " Key extractor for stable row identity" # prop(optional) key_fn : Option <KeyFn <T>>,) -> impl IntoView where T : Clone + 'static,Data table component.

`empty`

ItemWhat it is
fn EmptyState(# doc = " Title" title : & 'static str, # doc = " Description" # prop(optional) description : Option <& 'static str>, # doc = " Icon(SVG path)" # prop(optional) icon : Option <& 'static str>, # doc = " Action button" # prop(optional) children : Option <Children>,) -> impl IntoViewEmpty state component.
fn ErrorState(# doc = " Error title" # prop(default = "Something went wrong") title : & 'static str, # doc = " Error message" message : String, # doc = " Retry handler" # prop(optional) on_retry : Option <Callback <()>>,) -> impl IntoViewError state component.

`file_upload`

ItemWhat it is
pub struct UploadProgress
fn FileUpload(# doc = " Endpoint URL for POST /api/v1/admin/media." # prop(into) upload_url : String, # doc = " CSRF cookie name(consumer's ApiClient knows this)." # prop(into) csrf_cookie_name : String, # doc = " MIME types passed to the <input accept> attribute." # prop(into, default = "image/*" . to_string()) accept : String, # doc = " Fires when one file's progress changes(loaded/total/percent)." # prop(into) on_progress : Callback <UploadProgress>, # doc = " Fires on a per-file 2xx with the parsed UploadResponse." # prop(into) on_complete : Callback <UploadResponse>, # doc = " Fires on a per-file 4xx/5xx with (filename, error_code, detail)." # prop(into) on_error : Callback <(String, String, String)>, # doc = " Allow multi-file picks(defaults to single)." # prop(default = false) multiple : bool,) -> impl IntoView

`form`

ItemWhat it is
fn FormGroup(# doc = " Label text" # prop(into) label : String, # doc = " Field name/id" name : & 'static str, # doc = " Whether the field is required" # prop(default = false) required : bool, # doc = " Error message" # prop(optional) error : Option <String>, # doc = " Hint text" # prop(optional, into) hint : Option <String>, # doc = " Form control" children : Children,) -> impl IntoViewForm group wrapper for labels and inputs.
fn TextInput(# doc = " Input name/id" name : & 'static str, # doc = " Input type(text, email, password, etc.)" # prop(default = "text") input_type : & 'static str, # doc = " Placeholder text" # prop(optional) placeholder : Option <& 'static str>, # doc = " Current value(controlled)" # prop(optional) value : Option <RwSignal <String>>, # doc = " Change handler(uncontrolled)" # prop(optional) on_input : Option <Callback <String>>, # doc = " Whether the field is disabled" # prop(default = false) disabled : bool, # doc = " Whether the field is readonly" # prop(default = false) readonly : bool, # doc = " Whether there's an error" # prop(default = false) has_error : bool, # doc = " Additional classes" # prop(default = "") class : & 'static str,) -> impl IntoViewText input component.
fn TextArea(# doc = " Input name/id" name : & 'static str, # doc = " Placeholder text" # prop(optional) placeholder : Option <& 'static str>, # doc = " Number of rows" # prop(default = 4) rows : u32, # doc = " Current value(controlled)" # prop(optional) value : Option <RwSignal <String>>, # doc = " Change handler(uncontrolled)" # prop(optional) on_input : Option <Callback <String>>, # doc = " Whether the field is disabled" # prop(default = false) disabled : bool, # doc = " Whether there's an error" # prop(default = false) has_error : bool, # doc = " Additional classes" # prop(default = "") class : & 'static str,) -> impl IntoViewTextarea component.
pub struct SelectOptionSelect option.
SelectOption :: fn new(value : impl Into <String>, label : impl Into <String>) -> Self
fn Select(# doc = " Input name/id" name : & 'static str, # doc = " Options" options : Vec <SelectOption>, # doc = " Current value(controlled)" # prop(optional) value : Option <RwSignal <String>>, # doc = " Change handler" # prop(optional) on_change : Option <Callback <String>>, # doc = " Whether the field is disabled" # prop(default = false) disabled : bool, # doc = " Placeholder option text" # prop(optional) placeholder : Option <& 'static str>, # doc = " Whether there's an error" # prop(default = false) has_error : bool,) -> impl IntoViewSelect component.
fn Checkbox(# doc = " Input name/id" name : & 'static str, # doc = " Label text" label : & 'static str, # doc = " Checked state(controlled)" # prop(optional) checked : Option <RwSignal <bool>>, # doc = " Change handler" # prop(optional) on_change : Option <Callback <bool>>, # doc = " Whether the field is disabled" # prop(default = false) disabled : bool,) -> impl IntoViewCheckbox component.

`hierarchy_tree`

ItemWhat it is
pub const MAX_HIERARCHY_DEPTH: usizeMax nesting depth before the builder stops descending
pub struct HierarchyNode<T : Clone + 'static>Tree node carrying an arbitrary payload: T plus a display label, an id (for <For> keying + active matching), an optional count, and recursive children
HierarchyNode<T> :: fn new(id : impl Into <String>, label : impl Into <String>, payload : T) -> Self
HierarchyNode<T> :: fn with_count(mut self, count : i64) -> Self
HierarchyNode<T> :: fn with_children(mut self, children : Vec <HierarchyNode <T>>) -> Self
fn build_hierarchy_tree <T, IdFn, LabelFn, ParentFn, CountFn>(flat : & T, id_fn : IdFn, label_fn : LabelFn, parent_fn : ParentFn, count_fn : CountFn,) -> Vec <HierarchyNode <T>> where T : Clone + 'static, IdFn : Fn(& T) -> String, LabelFn : Fn(& T) -> String, ParentFn : Fn(& T) -> Option <String>, CountFn : Fn(& T) -> Option <i64>,Build a tree from a flat list
`fn HierarchyTree <T>(nodes : Vec <HierarchyNode <T>>, # doc = " Signal pointing at the currently-active node id(for highlight)." # prop(into, default = Signal::derive(\\

`image_cropper`

ItemWhat it is
fn ImageCropper(# doc = " Absolute or root-relative URL to the image(typically the" # doc = " large-WebP variant of the asset)." # prop(into) src : String, # doc = " Initial focal point coordinates in [0, 1. Falls back to(0.5,"] # doc = " 0.5) when either is None." # prop(into, default = None) initial_focal_x : Option <f64>, # prop(into, default = None) initial_focal_y : Option <f64>, # doc = " Fires on every drag step with the new normalized coords." # prop(into) on_change : Callback <(f64, f64)>,) -> impl IntoView

`loading`

ItemWhat it is
fn Spinner(# doc = " Size(sm, md, lg)" # prop(default = "md") size : & 'static str, # doc = " Color class" # prop(default = "text-blue-600") color : & 'static str,) -> impl IntoViewSpinner component.
fn LoadingOverlay(# doc = " Whether loading is active" loading : ReadSignal <bool>, # doc = " Loading text" # prop(default = "Loading...") text : & 'static str, # doc = " Content to overlay" children : Children,) -> impl IntoViewLoading overlay component.
fn PageLoading(# prop(default = "Loading...") text : & 'static str) -> impl IntoViewFull page loading state.
fn Skeleton(# doc = " Width class" # prop(default = "w-full") width : & 'static str, # doc = " Height class" # prop(default = "h-4") height : & 'static str,) -> impl IntoViewSkeleton loader for content placeholders.
fn SkeletonCard() -> impl IntoViewSkeleton card loader.
fn SkeletonTableRow(# prop(default = 4) columns : usize) -> impl IntoViewSkeleton table row loader.

`media`

ItemWhat it is
pub struct MediaItemGeneric media item for <MediaGrid> display
MediaItem :: fn new(id : Uuid, filename : impl Into <String>, url : impl Into <String>) -> Self
MediaItem :: fn with_content_type(mut self, ct : impl Into <String>) -> Self
MediaItem :: fn with_size_bytes(mut self, n : i64) -> Self
fn format_file_size(bytes : i64) -> StringFormat bytes as human-readable file size
fn is_image(content_type : & str) -> booltrue for image/* content types
fn DropZone(# doc = " Fires when the user drops files OR picks files via the click input." # doc = " Both paths normalize to a FileList." # prop(into) on_files : Callback <FileList>, # doc = " Reactive uploading indicator — when true, the drop zone shows a" # doc = " spinner overlay instead of the upload prompt." # prop(into, default = MaybeSignal::Static(false)) uploading : MaybeSignal <bool>, # doc = " accept attribute passed to the file input. Defaults to images." # prop(into, default = "image/*" . to_string()) accept : String, # doc = " Help-text shown under the upload prompt." # prop(into, default = "PNG, JPG, PDF up to 10MB" . to_string()) hint : String,) -> impl IntoViewDrag-drop upload region with click-to-pick file input
fn MediaGrid(# prop(into) items : Signal <Vec <MediaItem>>, # doc = " Optional delete action. When Some, hover overlay shows a delete" # doc = " button that calls this with the item id." # prop(default = None) on_delete : Option <Callback <Uuid>>, # doc = " Optional view action. When Some, hover overlay shows a view" # doc = " button that calls this with the item id. Consumer decides what" # doc = " view means(modal, new tab, route transition, etc.)." # prop(default = None) on_view : Option <Callback <Uuid>>,) -> impl IntoViewThumbnail grid for MediaItems

`media_picker`

ItemWhat it is
pub struct MediaPickerItemOne selectable asset in the picker grid.
MediaPickerItem :: fn new(id : impl Into <String>, thumbnail_url : impl Into <String>, filename : impl Into <String>,) -> Self
fn MediaPicker(# doc = " Whether the picker is open." open : ReadSignal <bool>, # doc = " Assets to choose from(consumer fetches/filters these)." items : Signal <Vec <MediaPickerItem>>, # doc = " Called with the chosen asset id." on_select : Callback <String>, # doc = " Called when the picker is dismissed." on_close : Callback <()>, # doc = " Optional search callback — when Some, a search box is shown and fires" # doc = " this with the query on input." # prop(default = None) on_search : Option <Callback <String>>, # doc = " Optional load-more callback — when Some, a \"Load more\" button is shown." # prop(default = None) on_load_more : Option <Callback <()>>,) -> impl IntoViewModal grid for selecting an existing media asset.

`modal`

ItemWhat it is
fn Modal(# doc = " Whether the modal is open" open : ReadSignal <bool>, # doc = " Close handler" on_close : Callback <()>, # doc = " Modal title. String, not &'static str: a translated title comes out" # doc = " of the i18n catalog at render time and cannot be a literal(staff-ui's" # doc = " no-unwrapped-literal gate would otherwise force every caller to ship an" # doc = " English title). #[prop(into) keeps title=\"Literal\" call sites"] # doc = " working unchanged." # prop(into) title : String, # doc = " Modal size" # prop(default = "md") size : & 'static str, # doc = " Whether clicking backdrop closes the modal" # prop(default = true) close_on_backdrop : bool, # doc = " Modal content" children : ChildrenFn,) -> impl IntoViewModal component.
fn ConfirmModal(# doc = " Whether the modal is open" open : ReadSignal <bool>, # doc = " Close handler" on_close : Callback <()>, # doc = " Confirm handler" on_confirm : Callback <()>, # doc = " Modal title — see [Modal's title for why this is a String."] # prop(into) title : String, # doc = " Confirmation message" message : String, # doc = " Confirm button text" # prop(default = "Confirm") confirm_text : & 'static str, # doc = " Cancel button text" # prop(default = "Cancel") cancel_text : & 'static str, # doc = " Whether the action is destructive" # prop(default = false) destructive : bool, # doc = " Optional DOM id for the confirm button(a stable test/automation" # doc = " hook). Rendered only when non-empty; needed when more than one" # doc = " ConfirmModal can be mounted at once(distinct ids per instance)." # prop(default = "") confirm_id : & 'static str,) -> impl IntoViewConfirmation modal.

`pagination`

ItemWhat it is
fn Pagination(# doc = " Current page(1-indexed)" current_page : ReadSignal <u32>, # doc = " Total number of pages" total_pages : ReadSignal <u32>, # doc = " Page change handler" on_page_change : Callback <u32>, # doc = " Number of page buttons to show" # prop(default = 5) visible_pages : usize,) -> impl IntoViewPagination component.
fn PageSizeSelector(# doc = " Current page size" page_size : ReadSignal <u32>, # doc = " Page size change handler" on_change : Callback <u32>, # doc = " Available page sizes" # prop(default = vec ! [10, 25, 50, 100)] options : Vec <u32>,) -> impl IntoViewPage size selector component.
fn PaginationInfo(# doc = " Current page(1-indexed)" current_page : ReadSignal <u32>, # doc = " Page size" page_size : ReadSignal <u32>, # doc = " Total items" total_items : ReadSignal <u32>,) -> impl IntoViewPagination info showing "Showing X to Y of Z results".

`photo_gallery`

ItemWhat it is
pub struct GalleryPhotoPhoto descriptor for <PhotoGallery>
GalleryPhoto :: fn new(id : Uuid, url : impl Into <String>) -> Self
GalleryPhoto :: fn primary(mut self) -> SelfMark this photo as the primary (renders first; sort_primary_first will place it ahead of non-primary photos).
fn sort_primary_first(photos : & mut GalleryPhoto)Sort photos so any with is_primary == true come first (stable otherwise)
fn PhotoGallery(photos : Vec <GalleryPhoto>, # doc = " Optional \"Make Primary\" callback. When Some and the thumb is not" # doc = " already first, hover overlay shows a ⬆ button that calls this with" # doc = " the photo id." # prop(default = None) on_set_primary : Option <Callback <Uuid>>, # doc = " Optional \"Delete\" callback. When Some, hover overlay shows a ✕" # doc = " button that calls this with the photo id." # prop(default = None) on_delete : Option <Callback <Uuid>>, # doc = " When true, action buttons are always visible(touch / a11y" # doc = " consumers). Default false preserves the donor's" # doc = " hover-only behavior." # prop(default = false) actions_always_visible : bool, # doc = " Optional empty-state slot. When Some, called once when photos" # doc = " is empty and the return value replaces the default placeholder" # doc = " SVG." # prop(default = None) empty_view : Option <Callback <(), View>>,) -> impl IntoViewPhoto gallery with main image + thumb strip + fullscreen lightbox

`picture`

ItemWhat it is
pub struct PictureSourceA WebP + JPEG source pair for a single rendered image.
PictureSource :: fn new(webp_url : impl Into <String>, jpeg_url : impl Into <String>, alt : impl Into <String>,) -> SelfNew source from a WebP URL, a JPEG fallback URL, and alt text.
PictureSource :: fn with_dimensions(mut self, width : u32, height : u32) -> SelfSet intrinsic dimensions (renders width/height to prevent layout shift).
fn Picture(# doc = " The WebP + JPEG source pair." source : PictureSource, # doc = " loading=\"lazy\"(default) vs \"eager\"(e.g. above-the-fold hero)." # prop(default = true) lazy : bool, # doc = " Extra classes applied to the <img>." # prop(into, optional) class : String,) -> impl IntoViewRender a <picture> with a WebP source and JPEG <img> fallback.

`rich_text_editor`

ItemWhat it is
fn RichTextEditor(# doc = " Initial markdown source." # prop(into) initial : String, # doc = " Fires on every keystroke with the current markdown source." # doc = " The host page reads this in its Save handler." # prop(into) on_change : Callback <String>, # doc = " Optional server-verified body_html(fetched + passed by the" # doc = " host page via a markdown-preview endpoint). When present," # doc = " replaces the local pulldown-cmark preview and shows the" # doc = " \"verified\" badge." # prop(into, default = create_rw_signal(None)) server_preview : RwSignal <Option <String>>,) -> impl IntoView

`selection`

ItemWhat it is
pub struct SelectionCtxCross-component selection context
fn SelectionCheckbox(item_id : Uuid, # prop(optional, into) class : String) -> impl IntoViewCheckbox overlay for item selection
fn has_selection_ctx() -> boolReturns true if a SelectionCtx is available in the current context.
pub struct ItemActionsCtxContext for triggering item-list refetch from nested components.
pub struct PendingActionPending destructive action waiting for user confirmation.
pub enum ActionKind
pub struct ConfirmCtxContext for requesting confirmation of destructive actions.
pub struct OpenMenuCtxSingle-open-menu enforcement for <ContextMenu>.

`toast`

ItemWhat it is
pub enum ToastTypeToast notification type.
pub struct ToastMessageToast message.
ToastMessage :: fn new(toast_type : ToastType, title : impl Into <String>) -> Self
ToastMessage :: fn with_message(mut self, message : impl Into <String>) -> Self
ToastMessage :: fn with_duration(mut self, duration_ms : u64) -> Self
ToastMessage :: fn success(title : impl Into <String>) -> Self
ToastMessage :: fn error(title : impl Into <String>) -> Self
ToastMessage :: fn warning(title : impl Into <String>) -> Self
ToastMessage :: fn info(title : impl Into <String>) -> Self
pub struct ToastContextToast context for managing toasts.
ToastContext :: fn new() -> Self
ToastContext :: fn show(& self, toast : ToastMessage)
ToastContext :: fn success(& self, title : impl Into <String>)
ToastContext :: fn error(& self, title : impl Into <String>)
ToastContext :: fn warning(& self, title : impl Into <String>)
ToastContext :: fn info(& self, title : impl Into <String>)
ToastContext :: fn dismiss(& self, id : & str)
ToastContext :: fn default() -> Self
fn use_toasts() -> ToastContextHook to get toast context.
fn ToastProvider(children : Children) -> impl IntoViewToast provider component.
fn Toast(toast : ToastMessage, on_dismiss : Callback <String>) -> impl IntoViewIndividual toast component.
fn ToastContainer(toasts : RwSignal <VecDeque <ToastMessage>>) -> impl IntoViewToast container component.

`typeahead_selector`

ItemWhat it is
pub const MAX_BREADCRUMB_DEPTH: usizeMax parent-chain walk depth (donor's 10) when building breadcrumbs
pub const MAX_TYPEAHEAD_RESULTS: usizeMax number of dropdown results rendered (donor's 15)
pub struct TypeaheadEntryPre-built entry for <TypeaheadHierarchySelector>
TypeaheadEntry :: fn new(id : Uuid, label : impl Into <String>, breadcrumb : impl Into <String>) -> Self
TypeaheadEntry :: fn with_badge(mut self, badge : impl Into <String>) -> Self
fn build_breadcrumb_entries <T, IdFn, LabelFn, ParentFn, BadgeFn>(flat : & T, id_fn : IdFn, label_fn : LabelFn, parent_fn : ParentFn, badge_fn : BadgeFn,) -> Vec <TypeaheadEntry> where IdFn : Fn(& T) -> Uuid, LabelFn : Fn(& T) -> String, ParentFn : Fn(& T) -> Option <Uuid>, BadgeFn : Fn(& T) -> Option <String>,Build typeahead entries from a flat list, walking parent_id chains to synthesize "Root > Mid > Leaf" breadcrumbs
fn filter_and_rank(entries : & TypeaheadEntry, query : & str) -> Vec <TypeaheadEntry>Filter + rank entries by query (lowercased), return top MAX_TYPEAHEAD_RESULTS
fn TypeaheadHierarchySelector(# doc = " Reactive list of available entries(consumer fetches + builds)." # prop(into) entries : Signal <Vec <TypeaheadEntry>>, # doc = " Currently selected entry id(None = no selection)." # prop(into) selected : Signal <Option <Uuid>>, # doc = " Fires when the user selects an entry(Some(id)) or clears the" # doc = " chip(None). Consumer mirrors to its own state via this." on_select : Callback <Option <Uuid>>, # doc = " Placeholder shown in the search input when no entry is selected." # prop(into, default = "Search…" . to_string()) placeholder : String,) -> impl IntoViewTypeahead hierarchy selector — chip-or-input toggle with a ranked dropdown showing breadcrumb chains

`view_toggle`

ItemWhat it is
fn load_view_mode(key : & str) -> ViewModeLoad view mode from localStorage with fallback to Cards.
fn save_view_mode(key : & str, mode : ViewMode)Save view mode to localStorage.
fn ViewToggle(mode : ReadSignal <ViewMode>, set_mode : WriteSignal <ViewMode>, # prop(into) storage_key : String,) -> impl IntoViewThree-mode toggle: Cards / Thumbnails / List.

Re-exports. Exported here, defined elsewhere.

ExportDefined in
ImageCropperimage_cropper::ImageCropper
RichTextEditorrich_text_editor::RichTextEditor
ViewModefoundation_view_mode::ViewMode
{Badge,BadgeVariant,DotBadge}badge::{Badge,BadgeVariant,DotBadge}
{Button,ButtonVariant,IconButton}button::{Button,ButtonVariant,IconButton}
{Checkbox,FormGroup,Select,SelectOption,TextArea,TextInput}form::{Checkbox,FormGroup,Select,SelectOption,TextArea,TextInput}
{Column,ColumnDef,DataTable}data_table::{Column,ColumnDef,DataTable}
{CompletionBanner,CompletionItem}completion_banner::{CompletionBanner,CompletionItem}
{ConfirmModal,Modal}modal::{ConfirmModal,Modal}
{ContextMenu,ContextMenuItem,DotColor}context_menu::{ContextMenu,ContextMenuItem,DotColor}
{EmptyState,ErrorState}empty::{EmptyState,ErrorState}
{FileUpload,UploadProgress}file_upload::{FileUpload,UploadProgress}
{LoadingOverlay,PageLoading,Skeleton,SkeletonCard,SkeletonTableRow,Spinner}loading::{LoadingOverlay,PageLoading,Skeleton,SkeletonCard,SkeletonTableRow,Spinner}
{MediaPicker,MediaPickerItem}media_picker::{MediaPicker,MediaPickerItem}
{PageSizeSelector,Pagination,PaginationInfo}pagination::{PageSizeSelector,Pagination,PaginationInfo}
{Picture,PictureSource}picture::{Picture,PictureSource}
{apply_theme,AccountHub,AccountLabels,AccountPort,AccountPreferences,AccountProfile,ChangePassword,LocaleOption,PortFuture,UpdateEmail,UpdatePreferences,UpdateProfile,THEME_STORAGE_KEY,}account_hub::{apply_theme,AccountHub,AccountLabels,AccountPort,AccountPreferences,AccountProfile,ChangePassword,LocaleOption,PortFuture,UpdateEmail,UpdatePreferences,UpdateProfile,THEME_STORAGE_KEY,}
{build_breadcrumb_entries,filter_and_rank,TypeaheadEntry,TypeaheadHierarchySelector,MAX_BREADCRUMB_DEPTH,MAX_TYPEAHEAD_RESULTS,}typeahead_selector::{build_breadcrumb_entries,filter_and_rank,TypeaheadEntry,TypeaheadHierarchySelector,MAX_BREADCRUMB_DEPTH,MAX_TYPEAHEAD_RESULTS,}
{build_hierarchy_tree,HierarchyNode,HierarchyTree,MAX_HIERARCHY_DEPTH}hierarchy_tree::{build_hierarchy_tree,HierarchyNode,HierarchyTree,MAX_HIERARCHY_DEPTH}
{format_file_size,is_image,DropZone,MediaGrid,MediaItem}media::{format_file_size,is_image,DropZone,MediaGrid,MediaItem}
{has_selection_ctx,ActionKind,ConfirmCtx,ItemActionsCtx,OpenMenuCtx,PendingAction,SelectionCheckbox,SelectionCtx,}selection::{has_selection_ctx,ActionKind,ConfirmCtx,ItemActionsCtx,OpenMenuCtx,PendingAction,SelectionCheckbox,SelectionCtx,}
{load_view_mode,save_view_mode,ViewMode,ViewToggle}view_toggle::{load_view_mode,save_view_mode,ViewMode,ViewToggle}
{make_selection_ctx,BulkActionBar}bulk_actions::{make_selection_ctx,BulkActionBar}
{render_nav_link_spec,route_matches_default,ActiveMatcher,MobileMenuToggle,NavGroup,NavLink,NavLinkSpec,SidebarCtx,SidebarShell,TopBarHeader,UserInfo,UserMenu,UserMenuDropdown,}admin_shell::{render_nav_link_spec,route_matches_default,ActiveMatcher,MobileMenuToggle,NavGroup,NavLink,NavLinkSpec,SidebarCtx,SidebarShell,TopBarHeader,UserInfo,UserMenu,UserMenuDropdown,}
{sort_primary_first,GalleryPhoto,PhotoGallery}photo_gallery::{sort_primary_first,GalleryPhoto,PhotoGallery}
{use_toasts,Toast,ToastContainer,ToastContext,ToastMessage,ToastProvider,ToastType,}toast::{use_toasts,Toast,ToastContainer,ToastContext,ToastMessage,ToastProvider,ToastType,}

Boundary

Reaches into foundation.

Shares tier platform with 9 other crates: platform-api, platform-corpus-console, platform-customer-ui, platform-disclosure-lab, platform-dto, platform-html-components, platform-privacy-scan-api, platform-staff-ui, … (9 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)platform
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/platform/leptos-components
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_platform["platform"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-view-mode`foundationnoalways
`platform-dto`platformnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
gloo-storage^0.3noalways
gloo-timers^0.3futuresnoalways
leptos^0.6csrnoalways
leptos_router^0.6csrnoalways
pulldown-cmark^0.10htmlnoalways
serde^1derivenoalways
serde_json^1noalways
uuid^1v4, v7, serde, jsnoalways
wasm-bindgen^0.2noalways
web-sys^0.3Window, Document, Storage, console, HtmlDocument, Request, … (30 total)noalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
wasm-bindgen-test^0.3noalways

Build. None.

Depended on by. 3 workspace crates.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_application_leptos_components["application-leptos-components"] -->|uses| SELF
  n_platform_customer_ui["platform-customer-ui"] -->|uses| SELF
  n_platform_staff_ui["platform-staff-ui"] -->|uses| SELF
  SELF["platform-leptos-components"]
  SELF -->|runtime| n_foundation_view_mode["foundation-view-mode"]
  SELF -->|runtime| n_platform_dto["platform-dto"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
cdylibplatform_leptos_components`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

3 workspace crates depend on this one: application-leptos-components, platform-customer-ui, platform-staff-ui.

Verification

KindCount
Unit tests69
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
account_hub13022
admin_shell1304
badge302
bulk_actions200
button303
completion_banner200
context_menu300
data_table402
empty200
file_upload201
form606
hierarchy_tree400
image_cropper101
loading601
media503
media_picker201
modal203
pagination301
photo_gallery300
picture200
rich_text_editor100
selection800
toast701
typeahead_selector600
view_toggle300

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc105159
Public modules with a //! block2525
pie showData
    title Public items with rustdoc
    "Documented" : 105
    "No rustdoc detected" : 54

Metrics

MetricValue
Rust source files26
Source lines6626
Code lines4833
Public API items159
Public modules25
Tests69
Examples0
Cargo features0
Direct runtime dependencies12
Workspace reverse dependencies3
pie showData
    title Public API by kind
    "constant" : 4
    "enum" : 6
    "function" : 63
    "method" : 53
    "struct" : 29
    "trait" : 1
    "type alias" : 3
pie showData
    title Rust source composition
    "Code" : 4833
    "Blank or comment" : 1793

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las platform · Manual