Skip to content

AI

AiAgentStatusBadge

Bit.BlazorUI.AI

BitAiAgentStatusBadge is a one-word summary of where an agent run stands, drawn as a BitTag whose color says the same thing the word does: a working run keeps the default look of a tag, a run waiting for the user is a warning, a completed one a success and a failed one an error, while an idle or cancelled run is a neutral one. It is a polite live region, so a screen reader user hears every transition without being interrupted. The header of every BitAiAgentRunView carries one.

Notes

To use this component, you need to install the Bit.BlazorUI.AI(opens in a new tab) nuget package, as described in the Optional steps of the Getting started page.

The badge takes a BitAiAgentRunStatus - usually the Status of a BitAiAgentRun (see AiAgentRunView). Its words come from the string table of the options in force (BitAiStrings.AgentIdle, AgentPlanning, AgentRunning, WaitingForYou, AgentCompleted, AgentFailed, AgentCancelled), so they are localized with the rest. Its root is the live region (role="status", aria-live="polite") and stays on the page across every status; a role or aria-live splatted onto it is honored instead. See it waiting on the user in the Agent asks a question scenario.

Usage

Every example is live. Open its code to see exactly what produced the component running underneath.

Basic

Give it a Status (a BitAiAgentRunStatus, usually the Status of a BitAiAgentRun): it says it in one word, drawn as a tag.

Running

Statuses

Every BitAiAgentRunStatus, in its word and its color. Planning and Running keep the default look of a tag; WaitingForInput is a warning, Completed a success, Failed an error; Idle and Cancelled are neutral.

IdlePlanningRunningWaiting for your answerDoneFailedStopped

Following a run

Bound to the status of a run, the badge says each transition as it happens. The root is a polite live region that stays on the page, so a screen reader announces every new word without interrupting what it is reading.



Idle

Words

The words are the string table's. A subclass of BitAiStrings - for another language, or another tone - handed down through a BitAiOptionsProvider (or registered with ConfigureUi) renames every status at once; what it does not override keeps its English.

Not startedThinking it throughWorking on itNeeds youFinishedCould not finishCancelled

Disabled

A Disabled badge draws its tag in the disabled look of a tag, whatever the status; the word stays. It is still the live region, so a change of status is still announced.

Running Waiting for your answer Failed

Cascading parameters

BitParams with a BitAiAgentStatusBadgeParams sets the look of every badge inside it - the ones the run views render included - and a badge's own value still wins (the last keeps its own Styles).

Running Waiting for your answer Done

Style & Class

Style and Class reach the root (the live region), Styles.Tag and Classes.Tag the tag inside it as a BitTagClassStyles. The badge has no variables of its own: the tag is restyled by the --bit-Tag-* ones, which reach the statuses drawn in the default look of a tag - the color of a waiting, completed or failed run is the badge's choice, and wins over them.

Running Done Failed Waiting for your answer

Planning Running Done

RTL

In right-to-left text the tag follows the direction - from Dir or from a dir around it - and the words of a right-to-left language come from its string table.

در حال اجرا منتظر پاسخ شما انجام شد

API

Every parameter, public member, sub-class and enum this component exposes.

BitAiAgentStatusBadge parameters

Name Type Default value Description
Classes BitAiAgentStatusBadgeClassStyles? null Custom CSS classes for different parts of the agent status badge.
Status BitAiAgentRunStatus BitAiAgentRunStatus.Idle The status to describe (required): the word comes from the string table of the options in force, and the color of the tag follows it - the default look of a tag for Planning and Running, the warning color for WaitingForInput, success for Completed, error for Failed and the neutral (tertiary) one for Idle and Cancelled.
Styles BitAiAgentStatusBadgeClassStyles? null Custom CSS styles for different parts of the agent status badge.

BitComponentBase parameters

Name Type Default value Description
AriaLabel string? null Gets or sets the accessible label for the component, used by assistive technologies.
Class string? null Gets or sets the CSS class name(s) to apply to the rendered element.
Dir BitDir? null Gets or sets the text directionality for the component's content.
Disabled bool false Gets or sets a value indicating whether the component is disabled and cannot respond to user interaction.
ForceAnimation bool false Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested.
HtmlAttributes Dictionary<string, object> new Dictionary<string, object>() Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters. An attribute written on the component wins over an entry of the same name.
Id string? null Gets or sets the unique identifier for the component's root element.
Style string? null Gets or sets the CSS style string to apply to the rendered element.
TabIndex string? null Gets or sets the tab order index for the component when navigating with the keyboard.
Visibility BitVisibility BitVisibility.Visible Gets or sets the visibility state (visible, hidden, or collapsed) of the component.

BitComponentBase public members

Name Type Default value Description
UniqueId Guid Guid.NewGuid() Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed.
RootElement ElementReference Gets the reference to the root HTML element associated with this component.

BitAiAgentStatusBadgeClassStyles properties

Name Type Default value Description
Root string? null Custom CSS classes/styles for the root element (the live region) of the BitAiAgentStatusBadge.
Tag BitTagClassStyles? null Custom CSS classes/styles for the BitTag of the BitAiAgentStatusBadge.

BitAiAgentRunStatus enum

Name Value Description
Idle 0 Created but not started. "Idle" (BitAiStrings.AgentIdle), neutral.
Planning 1 Deciding what to do before producing visible output. "Planning" (AgentPlanning), in the default look of a tag.
Running 2 Executing steps. "Running" (AgentRunning), in the default look of a tag.
WaitingForInput 3 Waiting on the user: an approval, a question, or missing input. "Waiting for your answer" (WaitingForYou), in the warning color.
Completed 4 Completed successfully. "Done" (AgentCompleted), in the success color.
Failed 5 Ended with an error. "Failed" (AgentFailed), in the error color.
Cancelled 6 Cancelled before completion. "Stopped" (AgentCancelled), neutral.

BitVisibility enum

Name Value Description
Visible 0 The content of the component is visible.
Hidden 1 The content of the component is hidden, but the space it takes on the page remains (visibility:hidden).
Collapsed 2 The component is hidden (display:none).

BitDir enum

Name Value Description
Ltr 0 Ltr (left to right) is to be used for languages that are written from the left to the right (like English).
Rtl 1 Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic).
Auto 2 Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.