Monitorex.Components.Core
(monitorex v0.3.0)
Copy Markdown
Reusable UI components for the Monitorex dashboard.
Provides a cohesive design system with dark theme, responsive layout, and accessible touch-friendly targets.
Components:
data_table/1— sortable, striped, responsive data tablesummary_card/1— card with icon, label, value, trendstatus_badge/1— color-coded HTTP status badgenode_selector/1— dropdown node selectorpage_header/1— page title with optional subtitle and actionsmetric_tile/1— compact metric displaypagination/1— page navigation with prev/next and numbered buttonsback_link/1— navigation back link
Summary
Functions
Renders a back link for detail pages.
Renders a sortable, striped data table with responsive card layout.
Renders a compact metric tile.
Renders a dropdown node selector.
Renders a page header with title, optional subtitle, and actions slot.
Renders a pagination control.
Renders a color-coded HTTP status badge.
Renders a summary card with icon, label, value, and optional trend indicator.
Functions
Renders a back link for detail pages.
Assigns
to— the URL to navigate back tolabel— link text (default: "Back")
Attributes
to(:string) (required)label(:string) - Defaults to"Back".
Renders a sortable, striped data table with responsive card layout.
Assigns
columns— list of maps with:label,:key, and optional:sortable?(boolean)rows— list of maps (each map has keys matching those in columns)empty_message— string to show when there are no rows
Events
"sort"— sent when a sortable column header is clicked, with the column key as the value
Attributes
columns(:list) (required)rows(:list) - Defaults to[].empty_message(:string) - Defaults to"No data".sort_by(:string) - Defaults tonil.sort_dir(:string) - Defaults tonil.
Renders a compact metric tile.
Assigns
label— metric labelvalue— metric value stringclass— additional CSS classes
Attributes
label(:string) (required)value(:string) (required)class(:string) - Defaults to"".
Renders a dropdown node selector.
Assigns
nodes— list of node names (strings)selected— currently selected node (string)event— event name to send on change
Attributes
nodes(:list) (required)selected(:string) - Defaults to"".event(:string) - Defaults to"select_node".
Renders a page header with title, optional subtitle, and actions slot.
Assigns
title— page title stringsubtitle— optional subtitle stringinner_block— optional content for the actions area (right side)
Attributes
title(:string) (required)subtitle(:string) - Defaults tonil.
Slots
inner_block
Renders a pagination control.
Assigns
current— current page number (integer)total— total number of pages (integer)event— event name to send on page change (default: "go_page")
Attributes
current(:integer) (required)total(:integer) (required)event(:string) - Defaults to"go_page".
Renders a color-coded HTTP status badge.
Assigns
status— integer HTTP status code
Colors:
- 2xx — green
- 3xx — blue
- 4xx — yellow
- 5xx — red
Attributes
status(:integer) (required)
Renders a summary card with icon, label, value, and optional trend indicator.
Assigns
label— card label stringvalue— display value stringtrend— optional:upor:downatom for trend iconicon— optional SVG icon HTML string (default: chart icon)class— additional CSS classes
Attributes
label(:string) (required)value(:string) (required)trend(:atom) - Defaults tonil.Must be one of:up,:down, ornil.icon(:string) - Defaults tonil.class(:string) - Defaults to"".