Skip to content

hmrc/play-frontend-hmrc

Repository files navigation

play-frontend-hmrc

This library contains all the Twirl components and helpers needed to implement frontend microservices on the HMRC tax platform.

play-frontend-hmrc is a Scala Twirl implementation of govuk-frontend and hmrc-frontend, adding to it Play, HMRC and tax platform-specific components and helpers that make the process of implementing frontend microservices straightforward and idiomatic for Scala developers.

Table of Contents

Getting started

Compatible Scala and Play Framework versions

This library is currently compatible with:

  • Play 3.0 - Scala 2.13 / 3

Understanding library changes between versions

We summarise what's changed between versions, and importantly any actions that may be required when upgrading past a specific version within our changelog.

Integrating with play-frontend-hmrc

  1. Add the library to the project dependencies:

    libraryDependencies += "uk.gov.hmrc" %% "play-frontend-hmrc-play-30" % "x.y.z"

    Where play-xx is your version of Play (e.g. play-30).

  2. Add a route for the hmrc-frontend static assets in conf/app.routes:

    ->         /hmrc-frontend                      hmrcfrontend.Routes
  3. Define your service name in your messages files. For example,

    service.name = Any tax service

    If you have a dynamic service name you can skip this step and pass the serviceName into HmrcStandardPage or HmrcStandardHeader.

  4. Create a layout template for your pages using the HMRC standard page template

  5. Problems with styling? Check our Troubleshooting section.

Troubleshooting

If you are adding HTML elements to your page such as <h1> or <p>, you will need to add the CSS classes for the GDS Transport fonts from the GOV.UK Design System. A full list of the CSS classes can be found at https://design-system.service.gov.uk/styles/type-scale/.

These styles have already been applied to the components supplied in play-frontend-hmrc, but you will need to manually add the styles to your service's own HTML elements.

Useful Links

Using components

Information how to use some of the components like banners, implicit methods can be found in a separate Markdown file.

Creating pages

Information how to enable GOV.UK brand refresh, link your accessibility statement, GTM/tracking consent configuration can be found in a separate Markdown file.

Advanced configuration

Information how to add your own SASS compilation pipeline, configuring non-HMRC project to resolve play-frontend-hmrc artefacts or using Tudor Crown on GOV.UK and HMRC components can be found in a separate Markdown file.

Owning team README

Rationale for code and translation decisions, dependencies, as well as instructions for team members maintaining this repository can be found here.

Getting help

Please report any issues with this library in Slack at #team-plat-ui.

License

This code is open source software licensed under the Apache 2.0 License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 20

Languages