Attachment example

With margin bottom

The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the GOV.UK Frontend spacing scale. It defaults to no margin bottom.

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/attachment", {
  attachment: {
    title: "Department for Transport information asset register",
    url: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/747661/department-for-transport-information-asset-register.csv",
    filename: "department-for-transport-information-asset-register.csv",
    content_type: "application/pdf",
    file_size: 20000
  },
  margin_bottom: 9
} %>