AI
AiConversationList
BitAiConversationList is the sidebar list of conversations, grouped by recency the way people think about them: today, yesterday, the previous seven days, the previous thirty days, then by month. It lists the BitAiConversationSummary records it is given, marks the open one, and raises OnSelect, OnNew and OnDelete - where the conversations are kept, and what switching does, is the app's.
Notes
Usage
Every example is live. Open its code to see exactly what produced the component running underneath.
Basic
New & delete
With a chat
TimeZone
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.
BitAiConversationList CSS variables
| Name | Default value | Description |
|---|---|---|
| --bit-AiConversationList-gap | spacing(0.25) | Room between two conversations, and between the parts of the list. |
| --bit-AiConversationList-padding | spacing(1) | Inset of the list. |
| --bit-AiConversationList-group-color | var(--bit-clr-fg-ter) | Text of the heading of a group. |
| --bit-AiConversationList-item-radius | var(--bit-shp-radius-control) | Corners of a conversation. |
| --bit-AiConversationList-item-color | var(--bit-clr-fg-pri) | Text of a conversation. |
| --bit-AiConversationList-item-background | transparent | Background of a conversation. |
| --bit-AiConversationList-item-hover-background | var(--bit-clr-bg-pri-hover) | Background of a conversation under the pointer. |
| --bit-AiConversationList-selected-color | var(--bit-clr-pri-fg) | Text of the conversation that is open. |
| --bit-AiConversationList-selected-background | var(--bit-clr-pri-tint) | Background of the conversation that is open. |
| --bit-AiConversationList-selected-hover-background | var(--bit-clr-bg-pri-hover) | Background of the conversation that is open, under the pointer. |
API
Every parameter, public member, sub-class and enum this component exposes.
BitAiConversationList parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| Classes | BitAiConversationListClassStyles? | null | Custom CSS classes for different parts of the conversation list. |
| Conversations | IReadOnlyList<BitAiConversationSummary>? | null | The conversations to list, in any order: they are sorted by UpdatedAt, newest first, and grouped into today, yesterday, the previous seven days, the previous thirty days, then by month - counted in the TimeZone, else in the TimeZone of the BitAiUiOptions in force, else in the browser's zone. |
| OnDelete | EventCallback<BitAiConversationSummary> | The callback for when the delete button of a conversation is pressed. The delete buttons are shown only while it is set; removing the conversation (and handing the list the new set) is the app's. | |
| OnNew | EventCallback | The callback for when the new-conversation button is pressed. | |
| OnSelect | EventCallback<BitAiConversationSummary> | The callback for when a conversation is chosen. Opening it - loading it, pointing the chat at its session - is the app's. | |
| SelectedId | string? | null | The ConversationId of the conversation currently open, which is marked with aria-current and set apart. |
| ShowNewButton | bool | true | Shows the new-conversation button at the top of the list. |
| Styles | BitAiConversationListClassStyles? | null | Custom CSS styles for different parts of the conversation list. |
| TimeZone | TimeZoneInfo? | null | The time zone the conversations are grouped by day in - what counts as today, yesterday, the previous seven and thirty days, and the month of an older one. While it is null, the TimeZone of the BitAiUiOptions in force, else the browser's: under Blazor Server the list is drawn in the zone of the server until the browser has said which zone it runs in. |
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. |
BitAiConversationListClassStyles properties
| Name | Type | Default value | Description |
|---|---|---|---|
| Root | string? | null | Custom CSS classes/styles for the root element of the BitAiConversationList. |
| NewButton | BitActionButtonClassStyles? | null | Custom CSS classes/styles for the new-conversation button of the BitAiConversationList. |
| GroupHeader | string? | null | Custom CSS classes/styles for the heading of each group of the BitAiConversationList. |
| List | string? | null | Custom CSS classes/styles for the list of each group of the BitAiConversationList. |
| Item | string? | null | Custom CSS classes/styles for each item of the BitAiConversationList. |
| ItemButton | string? | null | Custom CSS classes/styles for the button each conversation of the BitAiConversationList is chosen with. |
| SelectedItemButton | string? | null | Custom CSS classes/styles for the button of the conversation currently open in the BitAiConversationList, added to those of ItemButton. |
| ItemTitle | string? | null | Custom CSS classes/styles for the title of each conversation of the BitAiConversationList. |
| DeleteButton | BitButtonClassStyles? | null | Custom CSS classes/styles for the delete button of each conversation of the BitAiConversationList. |
BitAiConversationSummary properties
The lightweight projection of a conversation a list renders without loading its messages: a positional record, new BitAiConversationSummary(conversationId, title, updatedAt, preview?, messageCount?). BitAiConversation.ToSummary() and IBitAiConversationStore.ListAsync() return them.
| Name | Type | Default value | Description |
|---|---|---|---|
| ConversationId | string | The identifier of the conversation, which SelectedId is compared with. | |
| Title | string? | The display title. A conversation without one is listed under the Untitled string. | |
| UpdatedAt | DateTimeOffset | When the conversation last changed, which sorts the list and picks the group it is listed in. | |
| Preview | string? | null | A snippet of the last message, shown as the tooltip of the conversation. |
| MessageCount | int | 0 | How many messages the conversation holds. |
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.