AI
AiRendererBoundary
BitAiRendererBoundary contains a failure inside one custom renderer, so the rest of the conversation survives it. Custom renderers are handed data a model produced - shapes their author did not anticipate, and values that are still streaming - and without a boundary one such shape throws during rendering and takes the whole page with it. With one, the failed piece is replaced by a notice that says which piece failed, and the next render tries it again. It adds no element around content that renders.
Notes
Usage
Every example is live. Open its code to see exactly what produced the component running underneath.
Basic
Label
Recovery
nothing received yetCascading parameters
Style & Class
RTL
API
Every parameter, public member, sub-class and enum this component exposes.
BitAiRendererBoundary parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| ChildContent | RenderFragment? | null | The content to protect - typically a custom renderer of model output. It is rendered with no element of the boundary's own around it. What it throws while it renders, in the lifecycle methods of its components or in their event handlers replaces it with the notice; what a fire-and-forget task throws does not reach the boundary. For a throw to be caught it has to happen inside a component of the content: a RenderFragment that throws while the boundary itself builds it is the parent's failure. |
| Classes | BitAiRendererBoundaryClassStyles? | null | Custom CSS classes for different parts of the renderer boundary. |
| Label | string? | null | What the notice says once the content has failed. Left null, the RenderFailed text of the BitAiStrings in force ("This content could not be rendered") is shown. The message of the exception is the notice's tooltip either way. |
| Styles | BitAiRendererBoundaryClassStyles? | null | Custom CSS styles for different parts of the renderer boundary. |
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. |
BitAiRendererBoundaryClassStyles properties
| Name | Type | Default value | Description |
|---|---|---|---|
| Root | string? | null | Custom CSS classes/styles for the root element of the BitAiRendererBoundary, which is rendered only once its content has failed: the block the notice stands in. |
| Notice | BitTagClassStyles? | null | Custom CSS classes/styles for the notice (a BitTag) the BitAiRendererBoundary renders in place of its failed content. |
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.