Route Constraints in ASP.NET Core Blazor

@page "/route-parameter/{text?}"

<h1>Blazor is @Text!</h1>

@code {
    [Parameter]
    public string? Text { get; set; }

    protected override void OnInitialized()
    {
        Text = Text ?? "fantastic";
    }
}
@page "/user/{Id:int}/{Option:bool?}"

<p>
    Id: @Id
</p>

<p>
    Option: @Option
</p>

@code {
    [Parameter]
    public int Id { get; set; }

    [Parameter]
    public bool Option { get; set; }
}
Constraint Example Example Matches Invariant
culture
matching
bool {active:bool} trueFALSE No
datetime {dob:datetime} 2016-12-312016-12-31 7:32pm Yes
decimal {price:decimal} 49.99-1,000.01 Yes
double {weight:double} 1.234-1,001.01e8 Yes
float {weight:float} 1.234-1,001.01e8 Yes
guid {id:guid} CD2C1638-1638-72D5-1638-DEADBEEF1638{CD2C1638-1638-72D5-1638-DEADBEEF1638} No
int {id:int} 123456789-123456789 Yes
long {ticks:long} 123456789-123456789 Yes

References
https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing?view=aspnetcore-7.0#route-constraints