Sha256: 92940c8945f1525a7fd443cb8bc87d273c9aec9beeac36ad677116f8520ef79a

Contents?: true

Size: 1.86 KB

Versions: 143

Compression:

Stored size: 1.86 KB

Contents

name: Print link
description: A link with a print icon to help users print the current page
body: |
  This component renders two different outputs depending on whether a `href` is specified. By default, when no `href` is given, the component renders as a button and triggers a print action via JavaScript. In this case the component is hidden in environments where JavaScript is disabled and can be used as a progressive enhancement. When a `href` is specified the component renders as an anchor tag and navigates to that `href` without JavaScript, suitable for applications which have paths that trigger a print event on load.
accessibility_criteria: |
  - The print icon must be presentational and ignored by screen readers.
shared_accessibility_criteria:
  - link
examples:
  default:
    description: This component calls `print()` via the browser's DOM API. By default it relies on JavaScript and is not shown in environments where JavaScript is disabled. The \"link\" here is actually a button tag because this is not a navigation event. 
  with_different_text:
    data:
      text: "Print this manual"
  with_different_href:
    description: You can specify a alternative `href` URL that will override the default behaviour. When a `href` is specified the print link will render as an anchor tag and be displayed even when JavaScript is disabled.
    data:
      href: "/print"
  with_data_attributes:
    data:
      data_attributes:
        track-category: "printButton"
        track-action: "clicked"
        track-label: "Print this page"
  with_custom_margins:
    description: The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having margin level 3 on top and bottom.
    data:
      margin_top: 0
      margin_bottom: 4

Version data entries

143 entries across 143 versions & 1 rubygems

Version Path
govuk_publishing_components-28.9.2 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.9.1 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.9.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.8.1 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.8.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.7.1 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.6.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.5.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.4.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.3.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.2.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.1.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-28.0.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-27.20.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-27.19.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-27.18.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-27.17.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-27.16.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-27.15.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-27.14.2 app/views/govuk_publishing_components/components/docs/print_link.yml