Skip to content

Commit 2097188

Browse files
Describe the active and current arguments in header (#1098)
This adds the new current and active boolean options for primaryLinks in the header added in #1067 to the documentation in the component README.
1 parent 53a7e11 commit 2097188

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

packages/components/header/README.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -672,27 +672,29 @@ compiled JavaScript for all components `nhsuk.min.js` or the individual componen
672672

673673
The header Nunjucks macro takes the following arguments:
674674

675-
| Name | Type | Required | Description |
676-
| ------------------------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
677-
| **homeHref** | string | No | The href of the link for the logo and mobile home link in the navigation links. Defaults to "/". |
678-
| **ariaLabel** | string | No | Aria label for the logo href. Defaults to "NHS homepage". |
679-
| **organisation** | object | No | Settings for header with organisational logo. |
680-
| **organisation.name** | string | No | Organisation name value. |
681-
| **organisation.split** | string | No | Longer organisation names can be split onto multiple lines. |
682-
| **organisation.descriptor** | string | No | Organisation descriptor. |
683-
| **organisation.logoURL** | string | No | Organisation logo if using a static asset, such as PNG, is preferred. |
684-
| **primaryLinks** | array | No | Array of navigation links for use in the header. |
685-
| **primaryLinks[].href** | string | No | The href of a navigation item in the header. |
686-
| **primaryLinks[].text** | string | No | The link text of a navigation item in the header. |
687-
| **primaryLinks[].classes** | string | No | Optional additional classes to add to the list item. |
688-
| **primaryLinks[].attributes** | string | No | Any extra HTML attributes (for example data attributes) to add to the list item. |
689-
| **transactionalService** | object | No | Object containing the _name_ and _href_ of the transactional service. |
690-
| **service** | object | No | Object containing the _name_ and optional boolean _longName_ of the service. Set this to "true" if the service name is longer than 22 characters. |
691-
| **search** | object | No | Settings for the search input. |
692-
| **search.action** | string | No | The search action endpoint. Defaults to <https://www.nhs.uk/search> |
693-
| **search.name** | string | No | The name for the search field. Defaults to "q" |
694-
| **search.visuallyHiddenLabel** | string | No | The label for the search field. Defaults to "Search the NHS website" |
695-
| **classes** | string | No | Optional additional classes to add to the header container. Separate each class with a space. |
696-
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the header container. |
675+
| Name | Type | Required | Description |
676+
| ------------------------------ | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
677+
| **homeHref** | string | No | The href of the link for the logo and mobile home link in the navigation links. Defaults to "/". |
678+
| **ariaLabel** | string | No | Aria label for the logo href. Defaults to "NHS homepage". |
679+
| **organisation** | object | No | Settings for header with organisational logo. |
680+
| **organisation.name** | string | No | Organisation name value. |
681+
| **organisation.split** | string | No | Longer organisation names can be split onto multiple lines. |
682+
| **organisation.descriptor** | string | No | Organisation descriptor. |
683+
| **organisation.logoURL** | string | No | Organisation logo if using a static asset, such as PNG, is preferred. |
684+
| **primaryLinks** | array | No | Array of navigation links for use in the header. |
685+
| **primaryLinks[].href** | string | No | The href of a navigation item in the header. |
686+
| **primaryLinks[].text** | string | No | The link text of a navigation item in the header. |
687+
| **primaryLinks[].current** | boolean | No | Set to true if this links to the current page being shown. |
688+
| **primaryLinks[].active** | boolean | No | Set to true if the current page is within this section, but the link doesn’t necessarily link to the current page |
689+
| **primaryLinks[].classes** | string | No | Optional additional classes to add to the list item. |
690+
| **primaryLinks[].attributes** | string | No | Any extra HTML attributes (for example data attributes) to add to the list item. |
691+
| **transactionalService** | object | No | Object containing the _name_ and _href_ of the transactional service. |
692+
| **service** | object | No | Object containing the _name_ and optional boolean _longName_ of the service. Set this to "true" if the service name is longer than 22 characters. |
693+
| **search** | object | No | Settings for the search input. |
694+
| **search.action** | string | No | The search action endpoint. Defaults to <https://www.nhs.uk/search> |
695+
| **search.name** | string | No | The name for the search field. Defaults to "q" |
696+
| **search.visuallyHiddenLabel** | string | No | The label for the search field. Defaults to "Search the NHS website" |
697+
| **classes** | string | No | Optional additional classes to add to the header container. Separate each class with a space. |
698+
| **attributes** | object | No | Any extra HTML attributes (for example data attributes) to add to the header container. |
697699

698700
If you are using Nunjucks macros in production be aware that using `html` arguments, or ones ending with `html` can be a [security risk](https://developer.mozilla.org/en-US/docs/Glossary/Cross-site_scripting). Read more about this in the [Nunjucks documentation](https://mozilla.github.io/nunjucks/api.html#user-defined-templates-warning).

0 commit comments

Comments
 (0)