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.
| Prop | Type |
|---|---|
inverse | boolean |
LanguageNavigation.Composite
The Language navigation component helps users choose and switch between languages when using a service.
Children are ItemComposites.
| Prop | Type |
|---|---|
inverse | boolean |
itemsPrefer 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.
| Prop | Type |
|---|---|
hrefLink to the current page in this language. | string |
currentWhether this is the language of the current page. Defaults to | boolean |
languageDescriptionVisually 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 |
LanguageNavigation.Link
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.