Print link

Skip to HTML example

When to use this component

Use the print link component when users are likely to want a physical or PDF copy of the page content, such as:

  • confirmation pages after completing a transaction
  • reference information that users may want to keep
  • detailed guidance or instructions
  • receipts or summaries of submitted information

When not to use this component

Avoid using the print link component on pages where:

  • the content is primarily interactive or dynamic
  • the page contains forms that need to be completed online
  • the content is frequently updated and printed versions would quickly become outdated

How it works

The print link component displays a button that triggers the browser's native print dialog when clicked.

The component uses the govuk-!-display-none-print utility class to hide the button when printing, so it won't appear on the printed page.

The button requires JavaScript to function. The click handler is attached by the DfEComponents.PrintLink class, which is initialised automatically when DfEComponents.initAll() is called.

For the button to appear, either JavaScript must be enabled (via the .govuk-frontend-supported class on the body) or you can add the dfe-print-link--show-without-js class to show it without JavaScript support checking.

Accessibility

The print link component is accessible and follows GOV.UK Design System patterns:

  • Uses a semantic <button> element for the action
  • The printer icon uses aria-hidden="true" and focusable="false" to hide it from assistive technologies
  • Clear, descriptive button text that explains the action
  • Visible focus states that meet WCAG 2.1 requirements

HTML examples

Copy the HTML from this page directly into your web template.

Default print link

The default print link with a printer icon.

Default print link

Print link without icon

A simpler version without the printer icon.

Print link without icon

If you would like any additional advice or guidance with using these examples on Power Pages, please contact the Solutions Delivery Team.