Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Create Button View, ViewComponent and Model#45

Merged
akdalin-hee merged 4 commits into
mainfrom
feature/TD-5192-Create-buttons-view-component
May 1, 2025
Merged

Create Button View, ViewComponent and Model#45
akdalin-hee merged 4 commits into
mainfrom
feature/TD-5192-Create-buttons-view-component

Conversation

@akdalin-hee
Copy link
Copy Markdown

Description

Create Button View, ViewComponent and Model

Screenshots

Paste screenshots for all views created or changed: mobile, tablet and desktop, wave analyser showing no errors.
image


Developer checks

(Leave tasks unticked if they haven't been appropriate for your ticket.)

I have:

  • Run the IDE auto formatter on all files I’ve worked on and made sure there are no IDE errors relating to them
  • Written or updated tests for the changes and made sure all tests are passing
  • Manually tested my work with and without JavaScript (adding notes where functionality requires JavaScript)
  • Tested with Wave Chrome plugin. Addressed any valid accessibility issues and documented any invalid errors
  • Scanned over my pull request in GitHub and addressed any warnings from the GitHub Build and Test checks in the GitHub PR ‘Files Changed’ tab
    Either:
  • Documented my work in Confluence, updating any business rules applied or modified. Updated GitHub readme/documentation for the repository if appropriate. List of documentation links added/changed:
  • Confirmed that none of the work that I have undertaken requires any updates to documentation
  • CHANGELOG entry

@kevwhitt-hee
Copy link
Copy Markdown

We frequently style links as buttons and include role="button" attribute.

As an example we would have a "Next" submit button in a multi-step flow and to the left of it we would have a "Back" link styled as a secondary button.

They would obvs need a URL param too. We could cater for that in this component, potentially.

@wellhairy should we include this or should we not be using buttons in this way?

@wellhairy
Copy link
Copy Markdown
Collaborator

Sematically im not sure you're meant to add a role of button to a link. I think on occasion we do style a back or cancel links as buttons but i think it's common practice to style these as links. If we were to style a link as a button this would likely just be in styling alone.

Most of the time when you'd use a role="button" its to apply JS functionity or similar but it's more likely you'd just use a button element in most cases. I think the main reason for the role="button" is to tell assisted technology that something thats not normally a button, likea div, has button like functionality. See Button role.

The way the prototyping kit handles this is if a button component has a URL paramiter then it outputs a link with a class="nhsuk-button" or similar.

@wellhairy
Copy link
Copy Markdown
Collaborator

But yeah i think it'd be fine to add this functionality, I just think it'd probably come down to semantic use case or UR around a specific transctional journey.

…. Add ability to add custom inline css attributes
Copy link
Copy Markdown

@kevwhitt-hee kevwhitt-hee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@akdalin-hee akdalin-hee merged commit 9dfc266 into main May 1, 2025
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants