UI elements

Show status, progress and where users are with badges, alerts, timelines and bars.

Overview

Seven small Blazor controls, from BadgeControl to ProgressBarControl, that tell users what is happening and where they are. Use BadgeControl for counts and status, AlertControl for a message that stays on the page until closed, SkeletonControl while content loads, TimelineControl for the steps of a task or a history, BreadCrumbControl for the path to the current page, and ProgressBarControl or ChunkProgressBarControl for a long import.

Examples

#Badges, alerts and skeletons

Dismiss an alert and the count beside Open alerts drops; Refresh board swaps every row for skeletons while it loads. Each task carries a dot, a square code tag and a status badge.

Open alerts 4
Sprint 8 tasks
WEB-113 Site footer Done
WEB-117 Order form In review
WEB-118 Order emails In progress
WEB-120 Payment setup To do

#Timeline and breadcrumb

Complete the next step and the timeline moves on: done steps turn green with a check and a time (PointColor, IconCss, Time), the next one is amber, and each title says done, next or to do, so the state is not shown by color alone. The breadcrumb above shows where the task sits; its last item, the current page, is not a link.

2 of 5 steps done
Mon 9:00 AM
Brief: done
Order confirmation and pickup reminder emails.
Tue 2:10 PM
Design: done
Sign-off on both templates from Green Fork Cafe.
Build: next
Test sends of both emails from the preview site.
Review: to do
Code review by Hermione Ranger.
Release: to do
Part of the Sprint 8 release.

#Progress bars

Start the import of Green Fork Cafe's contact lists: a percentage bar with title, status and cancel, and two chunked bars over 0 to 5,000 lines, one horizontal with ten chunks and one vertical with five and no value.

Importing contact lists· not started

0% ยท file 1 of 3 · 0 of 5,000 lines in all

0%

Documentation

Read from the eight component files and their stylesheets. BadgeControl, AlertControl, SkeletonControl, TimelineControl and BreadCrumbControl inherit FlexControlBase; its CssClass, Style and unmatched attributes land on each root element and are listed once, in the last table, together with the base parameters these controls never read. TimelineItemControl does not inherit it: it has no CssClass or Style, and an attribute it does not declare is a runtime error. ChunkProgressBarControl inherits it but uses it differently, so its inherited parameters are in its own table. ProgressBarControl does not inherit it: it declares its own CssClass and Style, and an attribute it does not declare is a runtime error.

ParameterTypeDefaultDescription
Textstring?nullContent of the span when not empty; ChildContent is then ignored.
ChildContentRenderFragment?nullRendered only when Text is null or empty.
VariantBadgeVariantBadgeVariant.PrimaryPicks the color class, fx-badge-primary to fx-badge-dark; see the values below. An unknown value falls back to fx-badge-primary.
SizeBadgeSizeBadgeSize.MediumPicks fx-badge-sm, fx-badge-md or fx-badge-lg: font size and padding.
IsPillbooltrueAdds fx-badge-pill: fully rounded ends and wider side padding. False keeps the 4px corners of fx-badge. The pill's 0.65em side padding applies at every BadgeSize.
IsDotboolfalseAdds fx-badge-dot: an 8px circle with no padding. Text and ChildContent are still rendered inside it, so give a dot neither.
Titlestring?nullInherited from FlexControlBase. Declared, but BadgeControl never reads it, and because it binds to a parameter it is not passed through as a title attribute either: a Title on a dot badge renders nothing, so put its meaning in nearby text.
An unhandled error has occurred. Reload ๐Ÿ—™

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.