Sha256: 0cbae9daa044c257b12a714f13b4535575835edef734e293f115645e5e9f45d1

Contents?: true

Size: 1.87 KB

Versions: 18

Compression:

Stored size: 1.87 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

18 entries across 18 versions & 1 rubygems

Version Path
govuk_publishing_components-29.15.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.14.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.13.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.12.1 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.12.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.11.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.10.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.9.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.8.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.7.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.6.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.5.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.4.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.3.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.2.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.1.0 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.0.1 app/views/govuk_publishing_components/components/docs/print_link.yml
govuk_publishing_components-29.0.0 app/views/govuk_publishing_components/components/docs/print_link.yml