Skip to content
# AiAgentStatusBadge ## Description 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. ## 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. | | 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. | ## 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. | ## Enums ### 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. | ## Sub Classes ### 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. | ## Examples \n**Basic**: ```razor ``` \n**Statuses**: ```razor @foreach (var status in Enum.GetValues()) { } ``` \n**Following a run**: ```razor Run the agent ``` ```csharp private BitAiAgentRunStatus followedStatus = BitAiAgentRunStatus.Idle; private bool isFollowing; private async Task FollowRun() { isFollowing = true; BitAiAgentRunStatus[] lifecycle = [ BitAiAgentRunStatus.Planning, BitAiAgentRunStatus.Running, BitAiAgentRunStatus.WaitingForInput, BitAiAgentRunStatus.Running, BitAiAgentRunStatus.Completed, ]; foreach (var status in lifecycle) { followedStatus = status; StateHasChanged(); await Task.Delay(1500); } isFollowing = false; } ``` \n**Words**: ```razor @foreach (var status in Enum.GetValues()) { } ``` ```csharp private readonly BitAiUiOptions wordsOptions = BitAiUiOptions.Default with { Strings = new PlainStatusStrings() }; private sealed class PlainStatusStrings : BitAiStrings { public override string AgentIdle => "Not started"; public override string AgentPlanning => "Thinking it through"; public override string AgentRunning => "Working on it"; public override string WaitingForYou => "Needs you"; public override string AgentCompleted => "Finished"; public override string AgentFailed => "Could not finish"; public override string AgentCancelled => "Cancelled"; } ``` \n**Disabled**: ```razor ``` \n**Cascading parameters**: ```razor ``` ```csharp private readonly BitAiAgentStatusBadgeParams[] badgeParams = [ new() { Styles = new() { Tag = new() { Root = "border-radius: 1rem", Text = "font-weight: 600" } } } ]; ``` \n**Style & Class**: ```razor
``` \n**RTL**: ```razor
``` ```csharp private readonly BitAiUiOptions rtlOptions = BitAiUiOptions.Default with { Strings = new PersianStatusStrings() }; private sealed class PersianStatusStrings : BitAiStrings { public override string AgentRunning => "در حال اجرا"; public override string WaitingForYou => "منتظر پاسخ شما"; public override string AgentCompleted => "انجام شد"; } ```