AI
AiMessageActions
BitAiMessageActions is the row under a finished assistant message: copy, regenerate (with a session, for the newest reply) and thumbs up or down feedback, plus extra buttons of the app's own, and the metadata the BitAiUiOptions in force choose to show - the model, the token usage, the time. The actions are revealed while the message is hovered or holds the focus; the metadata is always shown. BitAiChatMessage renders one under every reply.
Notes
Usage
Every example is live. Open its code to see exactly what produced the component running underneath.
Basic
Pinned
Feedback
Regenerate
Extra actions
Options
Disabled
Cascading parameters
Style & Class
RTL
CSS variables
The public custom properties this component reads off its root, for what no parameter covers.
Every variable is read with a fallback and never declared by the component, so it inherits like any other custom property:
set one on :root (or in a [bit-theme] block) to restyle every instance, on any ancestor to restyle the ones inside it,
or on the Style of one instance to restyle it - and any instance nested inside it, which inherits the value too; a parameter changes one alone,
as does the real CSS property on the instance's Style / Styles when that property does not inherit (opacity: 1 keeps
one disabled instance undimmed without undimming a disabled one inside it), while an inherited one such as color or
font-family also reaches the nested instances that do not set it themselves. Leave a variable unset and the component
falls back to the theme token beside it.
BitAiMessageActions CSS variables
| Name | Default value | Description |
|---|---|---|
| --bit-AiMessageActions-gap | spacing(1.5) | Room between the group of actions and each piece of metadata. |
| --bit-AiMessageActions-actions-gap | spacing(0.5) | Room between two action buttons. |
| --bit-AiMessageActions-color | var(--bit-clr-fg-ter) | Text of the metadata: the model, the usage and the time. |
| --bit-AiMessageActions-font-size | var(--bit-tpg-fs-xs) | Size of the metadata. |
API
Every parameter, public member, sub-class and enum this component exposes.
BitAiMessageActions parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| CanRegenerate | bool | true | Offers regeneration of the message, when a Session is given. Only the newest assistant message should offer it, since regenerating an older one discards everything after it; a BitAiChatMessage sets it from its IsLatest. |
| Classes | BitAiMessageActionsClassStyles? | null | Custom CSS classes for different parts of the message actions. |
| ExtraActionsTemplate | RenderFragment? | null | The extra buttons appended to the row of actions, after the feedback buttons. They are revealed and hidden with the built-in ones, and left out with them when the ShowMessageActions of the options in force is off. |
| Message | BitAiMessage | The message these actions belong to (required): what copy copies, what feedback is recorded on, and where the model, the usage and the time are read from. | |
| OnFeedback | EventCallback<BitAiFeedbackKind> | The callback for when the user records feedback, so a host can persist it: Positive or Negative, or None when the user pressed the chosen one again to withdraw it. The message's Feedback is already updated when it is raised. A BitAiChatMessage (and the BitAiMessageList and BitAiChat around it) reports the same choice through its own OnFeedback as a BitAiMessageFeedback, which pairs it with the message (see the BitAiChatMessage page). | |
| Pinned | bool | false | Keeps the actions visible rather than revealing them while the message is hovered or holds the focus. |
| Session | BitAiChatSession? | null | The session driving the conversation of the message, which enables regeneration. |
| ShowFeedback | bool | true | Shows the thumbs up and thumbs down buttons. |
| Styles | BitAiMessageActionsClassStyles? | null | Custom CSS styles for different parts of the message actions. |
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. |
BitAiMessageActionsClassStyles properties
| Name | Type | Default value | Description |
|---|---|---|---|
| Root | string? | null | Custom CSS classes/styles for the root element of the BitAiMessageActions. |
| Actions | string? | null | Custom CSS classes/styles for the group of action buttons of the BitAiMessageActions. |
| RegenerateButton | BitButtonClassStyles? | null | Custom CSS classes/styles for the regenerate button of the BitAiMessageActions. |
| FeedbackButton | BitButtonClassStyles? | null | Custom CSS classes/styles for the two feedback buttons of the BitAiMessageActions. |
| Model | string? | null | Custom CSS classes/styles for the model name of the BitAiMessageActions. |
| Time | string? | null | Custom CSS classes/styles for the time of the BitAiMessageActions. |
BitAiFeedbackKind enum
| Name | Value | Description |
|---|---|---|
| None | 0 | No feedback given, or the feedback was withdrawn. |
| Positive | 1 | The response was helpful (thumbs up). |
| Negative | 2 | The response was not helpful (thumbs down). |
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.