{"id":15527222,"url":"https://github.com/govuk-ruby/govuk-design-system-rails","last_synced_at":"2025-04-23T12:16:38.895Z","repository":{"id":38102995,"uuid":"214440304","full_name":"govuk-ruby/govuk-design-system-rails","owner":"govuk-ruby","description":"Implementation of GOV.UK Design System components in Ruby on Rails","archived":false,"fork":false,"pushed_at":"2023-06-05T08:31:29.000Z","size":183,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T12:16:05.513Z","etag":null,"topics":["govuk","govuk-design-system","govuk-frontend","rails","ruby"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/govuk-design-system-rails","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/govuk-ruby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-11T13:14:03.000Z","updated_at":"2024-04-23T03:44:32.000Z","dependencies_parsed_at":"2025-03-05T12:42:08.965Z","dependency_job_id":null,"html_url":"https://github.com/govuk-ruby/govuk-design-system-rails","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/govuk-ruby%2Fgovuk-design-system-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/govuk-ruby%2Fgovuk-design-system-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/govuk-ruby%2Fgovuk-design-system-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/govuk-ruby%2Fgovuk-design-system-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/govuk-ruby","download_url":"https://codeload.github.com/govuk-ruby/govuk-design-system-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250430600,"owners_count":21429324,"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","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":["govuk","govuk-design-system","govuk-frontend","rails","ruby"],"created_at":"2024-10-02T11:05:07.648Z","updated_at":"2025-04-23T12:16:38.875Z","avatar_url":"https://github.com/govuk-ruby.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **NOTE: This gem has been deprecated. Please consider using https://github.com/DFE-Digital/govuk-components and https://github.com/DFE-Digital/govuk-formbuilder instead.**\n\n# GOV.UK Design System\n\n[![Gem Version](https://badge.fury.io/rb/govuk-design-system-rails.svg)](https://rubygems.org/gems/govuk-design-system-rails)\n![RSpec test suite](https://github.com/govuk-ruby/govuk-design-system-rails/workflows/RSpec%20test%20suite/badge.svg?branch=master)\n![Code style](https://github.com/govuk-ruby/govuk-design-system-rails/workflows/Code%20style/badge.svg?branch=master)\n\nThis gem contains a [Rails engine](https://guides.rubyonrails.org/engines.html) containing a Ruby on Rails port of some [GOV.UK Design System](https://design-system.service.gov.uk/) components.\n\nIt was originally extracted from Ruby applications built by the Office for Product Safety and Standards (see: https://github.com/UKGovernmentBEIS/beis-opss/pull/1374) and is by no means complete. Not every component is implemented and some components may not behave in exactly the same way as the originals. The project does aim for feature parity and PRs are welcome.\n\n## Compatibility\n\nYou **must** include the [govuk-frontend](https://github.com/alphagov/govuk-frontend/) assets (CSS, JS, images, etc.) in your application in order to make use of this library. These assets are not bundled with this gem. This gem aims for parity with a specific version of the `govuk-frontend` library.\n\n| This gem's version | Compatible with `govuk-frontend` version |\n|--------------------| --- |\n| 0.9.7              | 4.3.1 |\n| 0.9.0              | 4.1.0 |\n| 0.8.2              | 3.14.0 |\n\n# Installation\n\nAdd the following to your project's Gemfile:\n\n```ruby\ngem \"govuk-design-system-rails\"\n```\nand run `bundle install`\n\n# Design System Components\n\nThe [GOV.UK design system](https://design-system.service.gov.uk) provides a reference implementation of its components in Nunjucks, which are unfortunately not supported on Ruby. In lieu of that, we are implementing\nERB versions of the components that can be used throughout the applications.\n\n## Component implementations\n\nComponent implementations can be found in the [components directory](app/views/components). They try to follow the\nnunjucks implementations as close as possible. In particular, we are keeping the interface the same (param names etc.)\nto make translating code between the macros usage and our implementation as close as possible.\nThis means that we can use the documentation provided by design system for macro options,\ne.g. see [macro options for radios](https://design-system.service.gov.uk/components/radios/#options-example-default)\n\nNotable differences from nunjucks:\n- we are not allowing unescaped html in `html` attributes. Instead, the expected use-case is to build the required html\n    and `capture` it, e.g.:\n    ```erb\n    \u003c% html = capture do %\u003e\n      \u003ch3\u003eCustom html content\u003c/h3\u003e\n    \u003c% end %\u003e\n    \u003c%= govukLabel html: html, for: \"someId\" %\u003e\n    ```\n    This renders most `text` and `html` attributes functionally identical, but we are choosing to keep both for consistency\n    with nunjucks templates\n- We extended the govukSelect component to streamline using it as accessible autocomplete component.\n    Our version accepts extra options:\n    - is_autocomplete, when true, makes the select an\n    [accessible autocomplete](https://github.com/alphagov/accessible-autocomplete)\n    - show_all_values, when true and is_autocomplete true, makes the autocomplete show all values,\n    as well as adds an 'x' to remove currently selected value.\n- hidden fields in checkboxes, to account for rails checkboxes \"gotcha\". The default value is 0 but can be set through the 'unchecked_value' attribute.\n  https://apidock.com/rails/ActionView/Helpers/FormHelper/check_box\n\n## Rails integration\n\nTo simplify working with rails form helpers, we are also providing a bit of \"glue\" which infers the values that it\ncan from the form object and converts them into appropriate params for the view components. Those can be found\nin the [form_components directory](app/views/form_components).\n\nThe intent of keeping this \"glue\" separate from the component implementations is to make keeping the components up to\ndate with the corresponding macros as simple as possible.\n\nThe helpers accept a `form` parameter, when this is present, the `form_components` version of a component is used.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgovuk-ruby%2Fgovuk-design-system-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgovuk-ruby%2Fgovuk-design-system-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgovuk-ruby%2Fgovuk-design-system-rails/lists"}