Styles
Link
Use links to navigate between pages.
Read the Design System guidance for link
Import
import { Link } from 'govuk-react/link';Examples
Default
Code
<Link href="#">
Link example
</Link>Muted
Code
<Link
href="#"
variant="muted"
>
Link example
</Link>Text colour
Code
<Link
href="#"
variant="text-colour"
>
Link example
</Link>No visited state
Code
<Link
href="#"
noVisitedState
>
Link example
</Link>With react router
Code
<BrowserRouter>
<Link asChild>
<RouterLink to="/first">First link</RouterLink>
</Link>
<br />
<Link asChild>
<RouterLink to="/second">Second link</RouterLink>
</Link>
<Routes>
<Route path="/first" element={<p>First route</p>} />
<Route path="/second" element={<p>Second route</p>} />
</Routes>
</BrowserRouter>API reference
Link
Use links to navigate between pages.
| Prop | Type |
|---|---|
variant | "inverse" | "muted" | "text-colour" |
noUnderline | boolean |
noVisitedState | boolean |
asChildRender the only child (such as a router's link) instead of an | boolean |