shinyGovstyle (development version)
New features
- New
gov_summary_card()wraps a summary list in a GOV.UK summary card with a title and heading level, for pages that show several summary lists.
Breaking changes
-
gov_summary()no longer has anactionargument; remove it from any calls.
Bug fixes
-
gov_summary()keys no longer break mid-word in narrow columns (#89). -
govTable()no longer fails with “incorrect number of dimensions” when given a data frame with a single column. -
gov_summary(),gov_text(),download_button(),download_link()andskip_to_main()now attach the GOV.UK stylesheet themselves. Previously they were only styled when another shinyGovstyle component on the page had loaded it.
shinyGovstyle 0.3.0
CRAN release: 2026-10-15
This release is the transition to a stable v1.0.0. Functions and arguments that will be removed in v1.0.0 now give a deprecation warning that names what to use instead, so you can update your code before upgrading. Everything deprecated keeps working in this release.
Deprecations
- Four functions have been renamed to match the GOV.UK Design System component names. The old names still work, with a deprecation warning, and produce identical output:
-
insert_text()is nowinset_text(). Itstextargument is nowcontent, reflecting that it accepts more than plain text;insert_text(text = )gives a single warning pointing toinset_text(content = ). -
banner()is nowphase_banner(), with the same arguments. -
tag_Input()is nowgov_tag(), with the same arguments. -
panel_output(inputId, main_text, sub_text)is nowconfirmation_panel(inputId, title, content).
-
-
gov_layout()is deprecated. Usegov_main_layout(gov_row(gov_box(..., size = size)), inputID = inputID, width = width)instead; the warning explains how each argument maps across. There is no single-function replacement. -
contents_link()(deprecated in 0.2.0) will be removed in v1.0.0. Its warning now explains thatservice_navigation()is the recommended approach for multi-page layouts, and that in-page anchor links should be ordinary links to heading ids. -
word_count()is deprecated as it is no longer required:text_area_Input(word_limit = )now tracks and announces the word count entirely client-side, so the server-sideword_count()observer can be deleted. -
header()argumentsmain_text,secondary_text,main_link,secondary_link,main_alt_text, andsecondary_alt_textwill be removed in v1.0.0. The warnings for the four link and alt text arguments now say that they have no effect. -
govReactableOutput()’sheading_levelnow takes an integer from2Lto5L(default2L). The"h2"to"h5"strings still work for now, with a warning showing the integer to use.
Breaking changes
- Error message element ids changed from
<inputId>errorto<inputId>-error(matching the hint id format<inputId>-hint). This affectsradio_button_Input(),checkbox_Input(),date_Input(),text_Input(),text_area_Input(),file_Input(), andinput_field().error_on()anderror_off()have been updated to match and continue to work transparently; only custom CSS or JS that targets#fooerrorselectors needs updating to#foo-error. - Removed the experimental
full_width_overrides()function. Use the newwidthargument onheader(),footer(),phase_banner(),cookieBanner(),service_navigation()andgov_main_layout()instead (see below). -
bslibhas moved fromSuggeststoImports, since the newgov_page()function depends on it directly. If you install shinyGovstyle without itsSuggestsdependencies, you’ll now getbslibautomatically; if you pin dependencies some other way, addbslibto that list. - Heading and caption size arguments (e.g.
sizeonheading_text(),caption_sizeongovTable()andgovReactableOutput(), andlabel_sizeon form inputs likecheckbox_Input()) now throw an error if given anything other than"s","m","l", or"xl". Previously an invalid value was accepted silently and could produce broken styling.
New features
-
govReactable()gains acolumnsargument for column-specific overrides, such as fixing a column’s decimal places withreactable::colFormat(). Only the fields you set are applied; any field you leave unset keeps govReactable’s GOV.UK default for that column. Previously, passing acolumnsargument through...errored withformal argument "columns" matched by multiple actual arguments(#243). - New
gov_page()function, a GOV.UK-flavoured wrapper aroundbslib::page_fluid(). It sets<html lang="en">by default (screen readers use this to choose the right pronunciation and voice), adds adescriptionargument for the page’s<meta name="description">tag, and awidthargument that sets a default width for every shinyGovstyle component used inside it, so you don’t have to repeatwidth =on each one. A component that sets its ownwidthalways overrides the page default. -
header(),footer(),phase_banner(),cookieBanner(),service_navigation(),gov_main_layout()and the deprecatedgov_layout()gain awidthargument for building wider, dashboard-style layouts:"standard"(the default, GOV.UK’s usual 960px content width),"three-quarters"(three-quarters of the viewport, never narrower than standard),"full"(edge-to-edge, with grid gutters also removed), or a CSS length (e.g."1400px","90vw") for a custom max-width. -
external_link()’sadd_warningargument now also accepts"icon", in addition toTRUE/FALSE. Settingadd_warning = "icon"adds a small decorative arrow icon after the link text, giving sighted users a visual warning that the link opens in a new tab without repeating the “(opens in new tab)” text, which is useful for grouped links (see the “Grouped links” section of the “Headings and text” vignette). The icon is hidden from screen readers, which get the same hidden warning asadd_warning = FALSE. - New
update_page_title()function to update the browser tab title from server code, mirroringupdate_service_navigation(). Compose a title in the GOV.UK recommended format"<page> | <service>"by supplying bothpage_titleandservice_name. -
service_navigation()gainsauto_page_titleandpage_title_suffixarguments. Withauto_page_title = TRUE(the default) the browser tab title is kept in sync with the active nav link, both for direct clicks and for programmatic navigation viaupdate_service_navigation(). - New
service_navigation_server()wires every nav link to its tab panel in a single server-side call, eliminating the per-linkobserveEvent()boilerplate that multi-page apps previously needed. - New
navigate_to()combinesupdateTabsetPanel()andupdate_service_navigation()into one call for programmatic navigation (next / back buttons, footer shortcuts, modal links). Accepts apanelargument when the nav link inputId and the tab panel value differ. - New
update_radio_button_Input()function, the server-side companion toradio_button_Input()(mirroringshiny::updateRadioButtons()). Use it to change the selected option, choices, or label of a radio group from the server, for example to keep a cookies settings radio in sync with a cookie banner choice. See the new “Cookies and analytics” vignette. -
inset_text()(content),confirmation_panel()(content),noti_banner()(body_txt),details()(help_text),phase_banner()(label),warning_text()(text), andgov_summary()(info) now acceptshinytag objects (e.g.shiny::tags$b("Bold")) andshiny::tagList()values in addition to plain character strings. -
gov_list()(list) andaccordion()(descriptions) now acceptshinytag objects andshiny::tagList()values, so list items and accordion sections can contain links and other rich content.accordion()section content is no longer forced into a single paragraph, so it can hold block content such as lists or multiple paragraphs (plain-string sections are unchanged). - The
labelandhint_label/hint_inputarguments oflabel_hint(),text_Input(),text_area_Input(),date_Input(),select_Input(),checkbox_Input(), andradio_button_Input()now consistently accept plain strings, HTML strings,shinytag objects, andshiny::tagList()values. Previously labels accepted HTML strings but not tags, while hints accepted tags but not HTML strings. -
phase_banner()gains afeedback_urlargument that auto-generates the standard GOV.UK phase banner feedback text (e.g. “This is a new service - your feedback (opens in new tab) will help us to improve it.”), or contact-style text iffeedback_urlis amailto:link.labelis now optional, but exactly one oflabelorfeedback_urlmust be supplied. -
external_link()now natively supportsmailto:links: whenhrefstarts withmailto:, the “opens in new tab” attributes, text, and icon are all skipped, since a mailto link hands off to the mail client rather than opening a new tab. Existing link-text validations still apply.
Bug fixes
-
service_navigation()now gives an error when two links end up with the same inputID (for example"Page 1"and"Page-1", which both becomepage_1), rather than silently creating clashing links. Thelinksdocumentation now correctly says that inputIDs supplied in a named vector are cleaned up in the same way as generated ones.update_service_navigation(),navigate_to()andservice_navigation_server()now clean up the inputIDs you pass them in the same way, so an id such as"Page-Two"works in all of them. Previously they used the id as given, so it silently failed to match thepage_twolink. - The active
service_navigation()link now hasaria-current="page", as in the GOV.UK Design System, so screen readers announce which page is current. Previously only the visual highlight changed. The first link is now marked as the current page when the app loads. -
gov_tag()andvalue_box()now warn whencolouris not one of their supported colours (for example a typo such as"gren"), listing the options, rather than silently falling back to the default styling. Acolourthat is not a single string now gives a clear error. - Updated GOV.UK Frontend from v6.1.0 to v6.6.0.
-
button_Input(type = "start")now wraps a rich HTML label in a span so it wraps correctly on narrow screens, following GOV.UK Frontend 6.4.0. -
service_navigation()now syncs the browser tab title with the active page by default. Screen readers announce the title on navigation, so a static title is an accessibility issue for multi-page dashboards. This is a behaviour change; setauto_page_title = FALSEonservice_navigation()to restore the previous behaviour. -
header()no longer emits spurious deprecation warnings formain_link,secondary_link,main_alt_text, andsecondary_alt_textwhen those arguments are not used. -
accordion()sections now operate independently of one another, so expanding or collapsing sections in one accordion no longer affects a different accordion on the same page. -
accordion()sections and the “Show all sections” control now correctly announce their state viaaria-expanded, and toggling an individual section keeps the “Show all sections” control’s text, chevron, andaria-expandedstate in sync. - Error messages on input components now use
role="alert"so they are announced by screen readers when toggled viaerror_on(). - The visually hidden “Error:” prefix on input component error messages now comes before the message text, so screen readers announce “Error: Enter your name” rather than “Enter your name Error:”. The prefix also survives
error_on(error_message = ...), which previously replaced it. -
error_on()now escapes a plain stringerror_messageinstead of sending it to the browser as raw HTML, so it renders the same way as the message baked into the component (<and&are no longer swallowed, and interpolated user content can no longer inject markup). Pass ashinytag,shiny::tagList(), orshiny::HTML()to render markup deliberately. -
date_Input()now renders its hint before the error message, matching the GOV.UK Design System and the other input components. -
govReactable()table row, sort-header, and pagination highlights are now visible in Windows High Contrast / forced-colours mode. -
details()now applies the same HTML handling tohelp_textas it does tolabel, so HTML strings render consistently across both arguments. -
warning_text()now renders HTML strings intextconsistently with other body-content components. -
govTable()no longer errors with “evaluation nested too deeply: infinite recursion” on large tables (around 1200+ rows). It now warns when given more than 50 rows and recommendsgovReactable()for very large or interactive tables. - The
radio_button_Input()client binding now correctly replaces all options when sent anoptionsupdate (the previous selectors did not match the rendered markup, so option replacement silently did nothing). -
radio_button_Input()’s client binding now correctly reads and updates the group label (update_radio_button_Input(label = ...), and Shiny’s built-in bookmarking). The previous selector targeted the old<label for=...>markup, which no longer exists now that the label renders inside a<legend>via the shared fieldset helper. -
govTable()now renders rows in dataframe order (row order was previously silently reversed). -
text_area_Input()’s word-limit message is now a live region (aria-live="polite"), announced to screen readers a short pause after the user stops typing, matching the GOV.UK Design System character count component. Previously it updated visually on every keystroke but was never announced. -
radio_button_Input(),checkbox_Input(), anddate_Input()now wrap their contents in a<fieldset>with a<legend>(previously they used a<label>inside the fieldset, which is invalid and meant screen readers did not announce the question as group context). Any hint or error message is linked to the fieldset viaaria-describedby, so screen readers read the hint/error when the group receives focus.radio_button_Input(),checkbox_Input(), anddate_Input()gainlabel_size("s"/"m"/"l"/"xl", default"m") andheading_level(1-6, optional) arguments that control the legend size and optionally wrap it as a page heading following the GDS pattern. -
radio_button_Input()inputs and labels are now programmatically associated via matchingid/forattributes, and checkbox labels now also carryforattributes.date_Input()Day/Month/Year labels are likewise associated with their underlying inputs viafor/id. -
govTabsnow includes full ARIA roles (tablist,tab,tabpanel) and attributes (aria-selected,aria-controls,aria-labelledby) so screen readers correctly identify and navigate tabs.
shinyGovstyle 0.2.0
CRAN release: 2026-04-13
Breaking changes
-
header()argumentsmain_textandsecondary_texthave been renamed toorg_nameandservice_namerespectively. The old names are deprecated and will be removed in a future version. -
value_box()has had the redundantinputIdargument removed.
New features
- New
download_link(),download_button(), anddownload_radios()functions for download components. - New
external_link()function for creating safe, accessible external links that open in a new tab. - New
gov_list()function to render styled ordered and unordered lists. - New
service_navigation()function withupdate_service_navigation()andservice_nav_link()helpers for the GOV.UK service navigation component. - New
skip_to_main()function to add a skip-to-main-content accessibility link.
Minor improvements and bug fixes
- Accordion sections now toggle by clicking anywhere in the section header, not just the title text.
- File upload input now uses GDS-like styling.
-
footer()now supports links. -
gov_table()now supports reactive tables, sorting, and pagination. -
gov_table()no longer crashes whenwidth_overwrite = NULL. -
header()alt text validation softened from errors to warnings. -
header()has been fixed to correctly size and align on small screens, andservice_namenow wraps correctly on narrow viewports. - Many functions now cross-reference related functions in their help files.
- Table caption placement fixed.
- Updated govuk-frontend CSS from v5.4.0 to v6.1.0.
-
value_box()updated to use GOV.UK tag colours.
shinyGovstyle 0.1.1
CRAN release: 2026-01-08
- No user facing changes, moving to using snapshot testing for backlink_Input
shinyGovstyle 0.1.0
CRAN release: 2024-09-12
- Update the css to v5.4.0 and made fixes associated with that.
- No longer requires rem remover step to update for future changes.
- One of the major changes in the css is a change in look and functionality for the accordion. Show / hide all works as expected now.
- Another major change to how the radio buttons look and feel, in line with the v5.4.0 design examples.
- Added additional functions to the
run_examplefor ease of testing. - Added the contents_links() function as a helper for getting the styling and behaviour for left navigation.
shinyGovstyle 0.0.8
CRAN release: 2022-02-22
- Update the css to v4.0.0 and made fixes associated with that.
- One of the major changes in the css is a change in look for the accordion.
- Added new functions
gov_main_layout,gov_row,gov_boxandgov_textto give better control over the layouts. - Added tabs as a component using the
govTabcommand. - Added summary list as a component using the
gov_summarycommand. - Added error summary component (
error_summary) and error summary update (error_summary_update).
shinyGovstyle 0.0.7
CRAN release: 2021-11-04
- Improved the header so that you can adjust the logo size to suit.
- Fix some errors that appeared in the footer.
- Fix the word count function so that you only need to enter word count limit on the
text_areafunction. You can change the limit onword_countif needed. - Change the
run_exampleto a better versions that show more ways you can you the package. - Change the
backlink_Inputto a button so that you can use server to move between panels etc. - Added tags through the
tag_Inputfunction plus added to theuse_example. - Added cookie banner through the
cookieBannerfunction. - Added accordion through the
accordionfunction. - Added tables through the
govTablefunction.
shinyGovstyle 0.0.6
CRAN release: 2021-10-25
- Fix minor bugs from the issues list including data default and radio default.
- Added units test.
- Added an example function.
- Added a
NEWS.mdfile to track changes to the package. - Added a notification banner function.
- Got ready for CRAN release.
- Added output value to the documentation.
