Skip to main content
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

Use links to navigate between pages.

PropType
variant"inverse" | "muted" | "text-colour"
noUnderlineboolean
noVisitedStateboolean
asChild

Render the only child (such as a router's link) instead of an a, with the link classes merged onto it.

boolean