RenderFragment parameters
A RenderFragment
parameter is a segment of UI content. A RenderFragment
parameter is used to communicate UI content from the parent to the child. The UI content can include plain text, HTML markup, Razor markup, or another component.
The following code is for the Alert
component. The UI content of the Alert
component is displayed when the value of its Show
property is true
:
Alert.razor
@if (Show) { <div class="dialog-container"> <div class="dialog"> <div> @ChildContent </div> <div> ...