
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
This gem provides a suite of reusable components for the GOV.UK Design System. It is intended to provide a lightweight alternative to the GOV.UK Publishing Components library and is built with GitHubâs ViewComponent framework.
It 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.
The gem comes with a full guide 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.
All 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.
The provided components are:
This library also provides helpers for creating links, buttons, skip links and back to top links.
All of the components can be rendered in two ways:
directly using Railsâ #render
method:
<%= render GovukComponent::WarningTextComponent.new do %>
A serious warning
<% end %>
via the helper wrapper:
<%= govuk_warning_text do %>
A serious warning
<% end %>
The naming convention for helpers is govuk_
followed by the componentâs name in snake case. You can see the full list in GovukComponentsHelper.
This 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:
<%= govuk_tabs(title: 'Days of the week') do |component| %>
<% component.with_tab(label: 'Monday') do %>
<p>Mondayâs child is fair of face</p>
<% end %>
<% component.with_tab(label: 'Tuesday') do %>
<p>Tuesdayâs child is full of grace</p>
<% end %>
<% component.with_tab(label: 'Wednesday') do %>
<p>Wednesdayâs child is full of woe</p>
<% end %>
<% end %>
Here are the rendered tabs:
For examples on usage see the guide page.
Add this line to your config/application.rb
:
require "govuk/components"
Add this line to your applicationâs Gemfile:
gem 'govuk-components'
And then execute:
bundle
Or install it yourself as:
gem install govuk-components
Bug reports and feature requests are most welcome, please raise an issue or submit a pull request.
Currently we're using GOVUK Lint to ensure code meets the GOV.UK guidelines. Please ensure that any PRs also adhere to this standard.
To help keep the logs clean and tidy, please configure git to use your full name:
git config --global user.name "Julius Hibbert"
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that govuk-components demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.