# MozPageNav
`moz-page-nav` is a grouping of navigation buttons that is displayed at the page level,
intended to change the selected view, provide a heading, and have links to external resources.
```html story
Test 1
Test 2
Test 3
Support Link
External Link
```
## When to use
* Use moz-page-nav for single-page navigation to switch between different views.
* moz-page-nav also supports footer buttons for external and support links
* This component is intended to be used in about: pages such as about:icecatview, about:preferences, about:addons, about:debugging, etc.
## When not to use
* If you need a navigation menu that does not switch between views within a single page
## Code
The source for `moz-page-nav` and `moz-page-nav-button` can be found under
[toolkit/content/widgets/moz-page-nav](https://searchfox.org/mozilla-central/source/toolkit/content/widgets/moz-page-nav).
You can find an examples of `moz-page-nav` in use in the IceCat codebase in
[about:icecatview](https://searchfox.org/mozilla-central/rev/9783996dbd86f999cab50ea426079a7b10f28a2f/browser/components/icecatview/icecatview.html#53-88).
`moz-page-nav` can be imported into `.html`/`.xhtml` files:
```html
```
And used as follows:
```html
```
### Iconless variant
The `iconSrc` property of `moz-page-nav-button` is optional. This is intended to support more internal facing `about:` pages where the addition of icons is not necessary. In these cases, the code will look a bit simpler:
```html
```
And will render like this:
```html story
First iconless button
Second iconless button
Third iconless button
```
Please note that `moz-page-nav` does not currently support mixing `moz-page-nav-button`s with icons and iconless `moz-page-nav-button`s. To avoid display issue your nav should pick one type for primary and secondary nav buttons and stick with it.
### Fluent usage
Generally the `heading` property of
`moz-page-nav` will be provided via [Fluent attributes](https://mozilla-l10n.github.io/localizer-documentation/tools/fluent/basic_syntax.html#attributes).
To get this working you will need to format your Fluent message like this:
```
with-heading =
.heading = Heading text goes here
```
The `data-l10n-attrs` will be set up automatically via `MozLitElement`, so you can just specify `data-l10n-id` on your moz-page-nav as you would with any other markup:
```html
```
You also need to specify a `data-l10n-id` for each `moz-page-nav-button`:
```html
```
```
with-button-text = button text goes here
```