Related items
Related content, including topics, guidance and collections. Children are SectionComposites.
Import
import * as RelatedItems from 'govuk-react/related-items';Examples
Default
Code
<RelatedItems.Composite>
{(
<>
<RelatedItems.SectionComposite title="Travel abroad">
<RelatedItems.Item>
<Link href="#">Foreign travel advice</Link>
</RelatedItems.Item>
<RelatedItems.Item>
<Link href="#">Travel insurance</Link>
</RelatedItems.Item>
<RelatedItems.Item>
<Link href="#">
<strong>More</strong>
</Link>
</RelatedItems.Item>
</RelatedItems.SectionComposite>
<RelatedItems.SectionComposite title="Travel">
<RelatedItems.Item>
<Link href="#">Passports, travel and living abroad</Link>
</RelatedItems.Item>
</RelatedItems.SectionComposite>
</>
)}
</RelatedItems.Composite>API reference
RelatedItems.Root
Related content, such as topics, guidance and collections.
No props of its own. Other props are passed to the element it renders.
RelatedItems.Composite
Related content, including topics, guidance and collections. Children are SectionComposites.
| Prop | Type |
|---|---|
titleThe main heading. | ReactNode |
RelatedItems.Heading
No props of its own. Other props are passed to the element it renders.
RelatedItems.Item
No props of its own. Other props are passed to the element it renders.
RelatedItems.List
No props of its own. Other props are passed to the element it renders.
RelatedItems.Section
No props of its own. Other props are passed to the element it renders.
RelatedItems.SectionComposite
A labelled navigation section with a heading and a list. Children are Items.
| Prop | Type |
|---|---|
titleRequiredThe section heading, such as “Travel abroad”. Also labels the navigation landmark. | ReactNode |
RelatedItems.SectionHeading
No props of its own. Other props are passed to the element it renders.