Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions aspnetcore/blazor/components/render-modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,30 @@ The <xref:Microsoft.AspNetCore.Components.ComponentBase.RendererInfo?displayProp
* `InteractiveAuto` for Interactive Auto.
* `InteractiveWebAssembly` for Interactive WebAssembly.

Components use these properties to render content depending on their location or interactivity status. For example, a form can be disabled during prerendering and enabled when the component becomes interactive:
Components use these properties to render content depending on their location or interactivity status. The following examples demonstrate typical use cases.

Display content until a component is interactive:

```razor
@if (!RendererInfo.IsInteractive)
{
<p>Connecting to the assistant...</p>
}
else
{
...
}
```

Disable a button until a component is interactive:

```razor
<button @onclick="Send" disabled="@(!RendererInfo.IsInteractive)">
Send
</button>
```

Disable a form during prerendering and enable the form when the component is interactive:

```razor
<EditForm Model="Movie" ...>
Expand Down Expand Up @@ -256,7 +279,7 @@ Components use these properties to render content depending on their location or
}
```

The next example shows how to render markup to support performing a regular HTML action if the component is statically rendered:
Render markup to support performing a regular HTML action if the component is statically rendered:

```razor
@if (AssignedRenderMode is null)
Expand Down
Loading