shinyGovstyle (development version)
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. -
insert_text()argumenttexthas been renamed tocontentto reflect that it now accepts more than plain text. The old name is deprecated and will be removed in a future version. -
word_count()has been deprecated as it is no longer required fortext_area_Input(), which now tracks and announces the word count entirely client-side. - Removed the experimental
full_width_overrides()function. Use the newwidthargument onheader(),footer(),banner(),cookieBanner(),service_navigation(),gov_main_layout()andgov_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.
New features
- 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(),banner(),cookieBanner(),service_navigation(),gov_main_layout()andgov_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 — 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. -
insert_text()(content),panel_output()(sub_text),noti_banner()(body_txt),details()(help_text),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. -
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 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. - 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.
Minor improvements and bug fixes
-
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.
