@page

Define routing for a component. The route must start with a forward splash (/).


Example

@page "/page"
@page "/page/link-2"
@page "/page/link-3"
@page "/page/link-3/child-1"
@page "/page/link-3/child-2"

<NavLink href="page">Link 1</NavLink>
<NavLink href="page/link-2">Link 2</NavLink>
<NavLink href="page/link-3">Link 3</NavLink>
<NavLink href="page/link-3/child-1">Link 3.1</NavLink>
<NavLink href="page/link-3/child-2">Link 3.2</NavLink>
BLAZOR SCHOOL
Designed and built with care by our dedicated team, with contributions from a supportive community. We strive to provide the best learning experience for our users.
Docs licensed CC-BY-SA-4.0
Copyright © 2021-2025 Blazor School
An unhandled error has occurred. Reload 🗙