Beta

This is a new service and pages are being tested and improved.

Overview

Use this guidance to choose the correct way for users to close, hide or dismiss interactive elements. The control you use should reflect whether the element can be reopened, whether closing is reversible, and the effect on the user’s task.

Do not use any closing or dismissing control for elements that do not hide content or change state.

When to use a close ‘X’ icon

Use the close ‘X’ icon for components that interrupt the user’s journey or obscure other content, and can be reopened, like a dialog modal.

Position the icon in the top right of the component, ensure it is keyboard accessible and using it does not cause loss of data or any irreversible actions.

Do not use the icon for alerts or notifications that disappear permanently.

When to use a ‘Hide this message’ link

Use a ‘Hide this message’ text link for banners or notifications that cannot be restored once dismissed.

Use it for:

This makes the irreversibility clearer that an ‘X’ icon.

Using a toggle

Components with a toggle reveal or hide content without removing it from the page or interrupting their flow.

Use them when:

  • content can be shown or hidden in place
  • the user may need to re-open the content repeatedly
  • the action is clearly reversible

Examples of components with a toggle include accordions and the details component.

Back to top