Document list example

Highlighted result

Highlight one or more of the items in the list. This is used on finders to provide a ‘top result’ for a search. The highlight_text parameter is optional.

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/document_list", {
  items: [
    {
      link: {
        text: "Department for Education – Statistics at DfE",
        path: "/government/organisations/department-for-education/about/statistics",
        description: "The Department for Education publishes official statistics on education and children."
      },
      metadata: {
        public_updated_at: "2017-07-19 15:01:48 +0000",
        document_type: "Corporate information"
      },
      subtext: "First published during the 2007 Labour Government",
      highlight: true,
      highlight_text: "Most relevant result"
    },
    {
      link: {
        text: "State-funded school inspections and outcomes: management information",
        path: "/government/organisations/department-for-education/about/statistics",
        description: "Management information published monthly and a one-off publication of inspections and outcomes from 2005 to 2015."
      },
      metadata: {
        public_updated_at: "2017-07-19 15:01:48 +0000",
        document_type: "Statistical data set"
      },
      subtext: "First published during the 1996 Conservative Government"
    }
  ]
} %>