x-govuk / govuk-components

Lightweight Ruby on Rails components for developing with the GOV.UK Design System.
https://govuk-components.netlify.app
MIT License
149 stars 19 forks source link

Add an alternate syntax for summary lists #283

Closed peteryates closed 2 years ago

peteryates commented 2 years ago

Currently the only way to build them is using slots in the template. [TableComponent has a feature] where you can pass an array of arrays and it'll convert them to slots. It would make sense for Summary Lists to follow suit and mimc the Nunjucks style - something along the lines of:

[
  { key: "Key", value: "Value", actions: [
    { href: "/something", text: "Change", hidden_text: "the things" }
  ],
  ...
]
peteryates commented 2 years ago

Fixed in #289