Cookies on ons.gov.uk

Cookies are small files stored on your device when you visit a website. We use some essential cookies to make this website work.

We would like to set additional cookies to remember your settings and understand how you use the site. This helps us to improve our services.

You have accepted all additional cookies. You have rejected all additional cookies. You can change your cookie preferences at any time.

Skip to main content

Related content

Overview

Use the related content component to provide additional information to the user.

How to use this component

Nesting components

You can nest other components inside of the related content component.

To do this, you will need to use an additional secondary 'inner' component called onsRelatedContentSection().

This can be used multiple times to allow complete flexibility, while maintaining the correct spacing and styling.

To use this approach you need to implement onsRelatedContent() using the Nunjucks call block (opens in a new tab) 
You should then nest onsRelatedContentSection() inside using call().

See the “Nunjucks” tab output for the example to see how it works.

Variants

Use the social media links variant to show the user related social media pages.

Help improve this page

Let us know how we could improve this page, or share your user research findings. Discuss ‘Related content’ component on GitHub (opens in a new tab)