diff --git a/aspnetcore/blazor/components/integration.md b/aspnetcore/blazor/components/integration.md index 0fffdd55fe..40e8db1469 100644 --- a/aspnetcore/blazor/components/integration.md +++ b/aspnetcore/blazor/components/integration.md @@ -829,6 +829,17 @@ public IResult GetWelcomeComponent() } ``` +Only HTML markup for the rendered component is returned. Layouts and HTML page markup aren't automatically rendered with the component. To produce a complete HTML page, the app can maintain a [Blazor layout](xref:blazor/components/layouts) that provides HTML markup for ``, `
`, ``, and other tags. The component includes the layout with the [`@layout`](xref:mvc/views/razor#layout) Razor directive at the top of the component definition file, `Welcome.razor` for the example in this section. The following example assumes that the app has a layout named `RazorComponentResultLayout` (`Components/Layout/RazorComponentResultLayout.razor`): + +```razor +@using BlazorSample.Components.Layout +@layout RazorComponentResultLayout +``` + +You can avoid placing the `@using` statement for the `Layout` folder in individual components by moving it to the app's `_Imports.razor` file. + +For more information, see