You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/render-modes.md
+23-2Lines changed: 23 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,7 +226,28 @@ The <xref:Microsoft.AspNetCore.Components.ComponentBase.RendererInfo?displayProp
226
226
*`InteractiveAuto` for Interactive Auto.
227
227
*`InteractiveWebAssembly` for Interactive WebAssembly.
228
228
229
-
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:
229
+
Components use these properties to render content depending on their location or interactivity status. The following examples demonstrate typical use cases.
230
+
231
+
Display content and disable a button until a component is interactive:
232
+
233
+
```razor
234
+
@if (!RendererInfo.IsInteractive)
235
+
{
236
+
<p>Connecting to the assistant...</p>
237
+
}
238
+
else
239
+
{
240
+
// Code to display chatbot messages
241
+
}
242
+
243
+
...
244
+
245
+
<button ... disabled="@(chatState is null || !RendererInfo.IsInteractive)">
246
+
Send
247
+
</button>
248
+
```
249
+
250
+
A form can be disabled during prerendering and enabled when the component becomes interactive:
230
251
231
252
```razor
232
253
<EditForm Model="Movie" ...>
@@ -256,7 +277,7 @@ Components use these properties to render content depending on their location or
256
277
}
257
278
```
258
279
259
-
The next example shows how to render markup to support performing a regular HTML action if the component is statically rendered:
280
+
Render markup to support performing a regular HTML action if the component is statically rendered:
0 commit comments