Skip to main content
Components

Language navigation

The Language navigation component helps users choose and switch between languages when using a service.

Children are ItemComposites.

Import

import * as LanguageNavigation from 'govuk-react/language-navigation';

Examples

Default

Code
<LanguageNavigation.Root>
  <LanguageNavigation.List>
    <LanguageNavigation.ListItem>
      <LanguageNavigation.Text lang="en">English</LanguageNavigation.Text>
    </LanguageNavigation.ListItem>
    <LanguageNavigation.ListItem>
      <LanguageNavigation.Link href="#" lang="cy">
        Cymraeg
      </LanguageNavigation.Link>
    </LanguageNavigation.ListItem>
  </LanguageNavigation.List>
</LanguageNavigation.Root>

API reference

LanguageNavigation.Root

The Language navigation component helps users choose and switch between languages when using a service.

PropType
inverseboolean

LanguageNavigation.Composite

The Language navigation component helps users choose and switch between languages when using a service.

Children are ItemComposites.

PropType
inverseboolean
items

Prefer children, which memoise and re-render better.

ItemCompositeProps[]

LanguageNavigation.ItemComposite

A link to the page in another language, or the current language when current or there's no href.

PropType
href

Link to the current page in this language.

string
current

Whether this is the language of the current page. Defaults to true when href is not provided.

boolean
languageDescription

Visually hidden text after a language link to indicate what the link will do. Write it in the language of the link (for example, "Change the language to English").

ReactNode

No props of its own. Other props are passed to the element it renders.

LanguageNavigation.List

No props of its own. Other props are passed to the element it renders.

LanguageNavigation.ListItem

No props of its own. Other props are passed to the element it renders.

LanguageNavigation.Text

No props of its own. Other props are passed to the element it renders.