.NET 6 RC1 introduced the PageTitle component to handle this scenario.
The PageTitle component is inside of the Microsoft.AspNetCore.Components.Web namespace.
You can place the component anywhere within your Blazor app and the contents of the PageTitle will be reflected as the title of your page. If you have multiple PageTitle components, the one that has been rendered last will become the title of your page.
In this case, the title will be "Page Title 2":
@page "/counter"
<PageTitle>Page Title 1</PageTitle>
<PageTitle>Page Title 2</PageTitle>
For PageTitle and HeadContent to work, you do need to add the HeadOutlet as a root component.
If you're using Blazor WASM completely client-side (no pre-render), you need to add the following line to your Startup.cs file after adding your App as a root component:
builder.RootComponents.Add<HeadOutlet>("head::after");
The head::after CSS selector instructs where to render the output of the HeadOutlet which will be respected for HeadContent, but if there's a title tag already present, the existing title tag will be updated.
If you're using Blazor WASM with pre-rendering, you'd put the following line inside the head of your _Layout.cshtml file:
<component type="typeof(HeadOutlet)" render-mode="WebAssemblyPrerendered" />
This is assuming you have a _Layout.cshtml file from following Microsoft's docs to setup Blazor WASM pre-rendering.
If you want more details, I wrote a blog post on PageTitle, HeadContent, and HeadOutlet with more details at the Telerik Blog.
I also just found some very new documentation from Microsoft on PageTitle, HeadContent, etc that is relevant.