{"id":13879053,"url":"https://github.com/x-govuk/govuk-components","last_synced_at":"2025-10-08T17:11:36.346Z","repository":{"id":37028281,"uuid":"261491533","full_name":"x-govuk/govuk-components","owner":"x-govuk","description":"Lightweight Ruby on Rails components for developing with the GOV.UK Design System.","archived":false,"fork":false,"pushed_at":"2025-09-08T15:12:11.000Z","size":3546,"stargazers_count":178,"open_issues_count":3,"forks_count":23,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-10-07T19:10:53.328Z","etag":null,"topics":["components","govuk","govuk-components","govuk-frontend","project","rails","viewcomponent"],"latest_commit_sha":null,"homepage":"https://govuk-components.netlify.app","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x-govuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-05T14:15:18.000Z","updated_at":"2025-10-07T10:50:34.000Z","dependencies_parsed_at":"2023-07-27T06:40:46.319Z","dependency_job_id":"a2bb52b9-d505-4a91-b84a-52b3f3c75d8b","html_url":"https://github.com/x-govuk/govuk-components","commit_stats":{"total_commits":995,"total_committers":30,"mean_commits":"33.166666666666664","dds":"0.28844221105527634","last_synced_commit":"af6c7d2de589242c4350df5ac25b7ef632d71e6c"},"previous_names":["x-govuk/govuk-components","dfe-digital/govuk-components"],"tags_count":101,"template":false,"template_full_name":null,"purl":"pkg:github/x-govuk/govuk-components","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-govuk%2Fgovuk-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-govuk%2Fgovuk-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-govuk%2Fgovuk-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-govuk%2Fgovuk-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x-govuk","download_url":"https://codeload.github.com/x-govuk/govuk-components/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-govuk%2Fgovuk-components/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278981518,"owners_count":26079640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["components","govuk","govuk-components","govuk-frontend","project","rails","viewcomponent"],"created_at":"2024-08-06T08:02:08.228Z","updated_at":"2025-10-08T17:11:36.338Z","avatar_url":"https://github.com/x-govuk.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# GOV.UK Components for Ruby on Rails\n\n[![Tests](https://github.com/x-govuk/govuk-components/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/x-govuk/govuk-components/actions/workflows/tests.yml)\n[![Gem version](https://badge.fury.io/rb/govuk-components.svg)](https://badge.fury.io/rb/govuk-components)\n[![Gem](https://img.shields.io/gem/dt/govuk-components?logo=rubygems)](https://rubygems.org/gems/govuk-components)\n[![Licence](https://img.shields.io/github/license/x-govuk/govuk-components)](https://github.com/x-govuk/govuk-components/blob/main/LICENSE.txt)\n[![GOV.UK Design System version](https://img.shields.io/badge/GOV.UK%20Design%20System-5.11.2-brightgreen)](https://design-system.service.gov.uk)\n[![ViewComponent](https://img.shields.io/badge/ViewComponent-3.24.0-brightgreen)](https://viewcomponent.org/)\n[![Rails](https://img.shields.io/badge/Rails-7.1.5%20%E2%95%B1%207.2.2%20%E2%95%B1%208.0.0-E16D6D)](https://weblog.rubyonrails.org/releases/)\n[![Ruby](https://img.shields.io/badge/Ruby-3.2.5%20%20%E2%95%B1%203.2.6%20%20%E2%95%B1%203.3.6-E16D6D)](https://www.ruby-lang.org/en/downloads/)\n\nThis gem provides a suite of reusable components for the [GOV.UK Design System](https://design-system.service.gov.uk/). It is intended to provide a lightweight alternative to the [GOV.UK Publishing Components](https://github.com/alphagov/govuk_publishing_components) library and is built with GitHub’s [ViewComponent](https://github.com/github/view_component) framework.\n\nIt aims to implement the functionality from the original Nunjucks macros in a way that will feel more familiar to Rails developers. Blocks are preferred over strings of HTML, beneath the surface each component is just a Ruby object, everything is inheritable and overrideable.\n\n## Documentation\n\nThe gem comes with [a full guide](https://govuk-components.netlify.app/) that covers most aspects of day-to-day use, along with code and output examples. The examples in the guide (and the guide itself) are built using the components, so it will always be up to date.\n\n[![Netlify Status](https://api.netlify.com/api/v1/badges/d40a5a0a-b086-4c35-b046-97fbcbf9f219/deploy-status)](https://app.netlify.com/sites/govuk-components/deploys)\n\n## What’s included?\n\nAll of the non-form components from the GOV.UK Design System are implemented by this library as ViewComponents. Form components are implemented by the [GOV.UK Form Builder](https://govuk-form-builder.netlify.app/).\n\nThe provided components are:\n\n* [Accordion](https://govuk-components.netlify.app/components/accordion)\n* [Back link](https://govuk-components.netlify.app/components/back-link)\n* [Breadcrumbs](https://govuk-components.netlify.app/components/breadcrumbs)\n* [Cookie banner](https://govuk-components.netlify.app/components/cookie-banner)\n* [Details](https://govuk-components.netlify.app/components/details)\n* [Exit this page](https://govuk-components.netlify.app/components/exit-this-page)\n* [GOV.UK footer](https://govuk-components.netlify.app/components/footer)\n* [GOV.UK header](https://govuk-components.netlify.app/components/header)\n* [Inset text](https://govuk-components.netlify.app/components/inset-text)\n* [Notification banner](https://govuk-components.netlify.app/components/notification-banner)\n* [Panel](https://govuk-components.netlify.app/components/panel)\n* [Pagination](https://govuk-components.netlify.app/components/pagination)\n* [Phase banner](https://govuk-components.netlify.app/components/phase-banner)\n* [Section break](https://govuk-components.netlify.app/components/section-break)\n* [Start button](https://govuk-components.netlify.app/components/start-button)\n* [Summary list](https://govuk-components.netlify.app/components/summary-list)\n* [Tabs](https://govuk-components.netlify.app/components/tabs)\n* [Tables](https://govuk-components.netlify.app/components/table)\n* [Tags](https://govuk-components.netlify.app/components/tag)\n* [Task list](https://govuk-components.netlify.app/components/task-list)\n* [Warning text](https://govuk-components.netlify.app/components/warning-text)\n\nThis library also provides helpers for creating [links](https://govuk-components.netlify.app/helpers/link),\n[buttons](https://govuk-components.netlify.app/helpers/button), [skip links](https://govuk-components.netlify.app/helpers/skip-link)\nand [back to top links](https://govuk-components.netlify.app/helpers/back-to-top-link).\n\n## Alternative syntax\n\nAll of the components can be rendered in two ways:\n\n* directly using Rails’ `#render` method:\n\n  ```erb\n    \u003c%= render GovukComponent::WarningTextComponent.new do %\u003e\n      A serious warning\n    \u003c% end %\u003e\n  ```\n\n* via the helper wrapper:\n\n  ```erb\n    \u003c%= govuk_warning_text do %\u003e\n      A serious warning\n    \u003c% end %\u003e\n  ```\n\n  The naming convention for helpers is `govuk_` followed by the component’s name in snake case. You can see the full list in [GovukComponentsHelper](app/helpers/govuk_components_helper.rb).\n\n## Example use\n\nThis library allows components to be rendered with Rails’ `render` method or via the provided helpers. Here we’ll use the `govuk_tabs` to render three tabbed sections:\n\n```erb\n\u003c%= govuk_tabs(title: 'Days of the week') do |component| %\u003e\n  \u003c% component.with_tab(label: 'Monday') do %\u003e\n    \u003cp\u003eMonday’s child is fair of face\u003c/p\u003e\n  \u003c% end %\u003e\n\n  \u003c% component.with_tab(label: 'Tuesday') do %\u003e\n    \u003cp\u003eTuesday’s child is full of grace\u003c/p\u003e\n  \u003c% end %\u003e\n\n  \u003c% component.with_tab(label: 'Wednesday') do %\u003e\n    \u003cp\u003eWednesday’s child is full of woe\u003c/p\u003e\n  \u003c% end %\u003e\n\u003c% end %\u003e\n```\n\nHere are the rendered tabs:\n\n![Tabs preview](docs/images/tabs.png)\n\nFor examples on usage see the [guide page](https://govuk-components.netlify.app/).\n\n## Setup\n\nAdd this line to your `config/application.rb`:\n\n```ruby\nrequire \"govuk/components\"\n```\n\n## Services using this library\n\n* [Apply for teacher training](https://github.com/DFE-Digital/apply-for-teacher-training)\n* [Find postgraduate teacher training](https://github.com/DFE-Digital/find-teacher-training)\n* [Get help with technology](https://github.com/DFE-Digital/get-help-with-tech)\n* [Publish teacher training courses](https://github.com/DFE-Digital/publish-teacher-training)\n* [Register trainee teachers](https://github.com/DFE-Digital/register-trainee-teachers)\n* [Teaching Vacancies](https://github.com/DFE-Digital/teaching-vacancies)\n\n## Forks\n\n* [Betagouv Système de Design de l'État view components](https://betagouv.github.io/dsfr-view-components/)\n\n## Installation\n\nAdd this line to your application’s Gemfile:\n\n```ruby\ngem 'govuk-components'\n```\n\nAnd then execute:\n\n```sh\nbundle\n```\n\nOr install it yourself as:\n\n```sh\ngem install govuk-components\n```\n\n## Contributing\n\nBug reports and feature requests are most welcome, please raise an issue or submit a pull request.\n\nCurrently we're using [GOVUK Lint](https://github.com/alphagov/govuk-lint) to ensure code meets the GOV.UK guidelines. Please ensure that any PRs also adhere to this standard.\n\nTo help keep the logs clean and tidy, please configure git to use your full name:\n\n```sh\ngit config --global user.name \"Julius Hibbert\"\n```\n\n## Licence\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-govuk%2Fgovuk-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx-govuk%2Fgovuk-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-govuk%2Fgovuk-components/lists"}