Contents list example

Nested with formatted numbers

How it looks (preview)

How to call this example

<%= render "govuk_publishing_components/components/contents_list", {
  format_numbers: true,
  contents: [
    {
      href: "#first-thing",
      text: "1. First thing",
      items: [
        {
          href: "#second-thing",
          text: "2. Numbers not parsed"
        },
        {
          href: "#third-thing",
          text: "3. Numbers are just text"
        }
      ]
    },
    {
      href: "#first-thing",
      text: "2. Next thing",
      items: [
        {
          href: "#second-thing",
          text: "No numbers here"
        },
        {
          href: "#third-thing",
          active: true,
          text: "None here either"
        }
      ]
    }
  ]
} %>