-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add task list component #425
Comments
One complication of the task list is that the "status" can either contain raw text (or HTML) or it can contain a tag component. The API for the nunjucks macro looks like this: {{ govukTaskList({
items: [
{
title:
{
text: "Company Directors"
},
href: "#",
status: {
text: "Completed"
}
},
{
title:
{
text: "Registered company details"
},
href: "#",
status: {
tag: {
text: "Incomplete",
classes: "govuk-tag--blue"
}
}
}
]
}) }} The ruby helper could be quite similar, but with shortcuts for setting colour? govuk_task_list(items: [
{
title: "Company details",
href: "#",
status: { text: "Completed" }
}, {
title: "Registered company details",
href: "#",
status: { tag: { text:"Completed", colour: "blue" } }
}
]) Alternatively (or in addition?) it could support "slots" using the block syntax: govuk_task_list do |task_list|
task_list.with_item(title: "Company details", href: "#", status: { text: "Completed" })
task_list.with_item(title: "Registered company details", href: "#", status: { tag: { text:"Completed", colour: "blue" })
end Any thoughts @peteryates @paulrobertlloyd? |
I didn't realise it had progressed this far, how exciting. Your proposed syntax looks great to me, supporting both styles should be straightforward - the approach taken by the summary list and table works well. |
Following the release of [GOV.UK Design System v5.0](https://github.com/alphagov/govuk-design-system/milestone/16), govuk-components v5.0.0 will be released. The headline features are: * support for GOV.UK Design System v5.0 * inclusion of [the task list component](alphagov/govuk-frontend#2261) #425 * all new link helpers #419 * update header to use new SVG which combines the crown and the GOV.UK test #466 Release notes will be drafted in #469.
This is a placeholder issue where we can discuss how best to add the Task list component which has now been added to govuk-frontend but not yet released.
The text was updated successfully, but these errors were encountered: