Dojo NG is being built in the open, one section at a time — follow along on Heptapod.

API REFERENCE · NAVIGATION

<dj-forward-button>

A Forward button that follows the app's navigation history.

It is built on <dj-button>, so keyboard use, focus, and button semantics come from there. Install @dojo-ng/history once at startup; the button finds it through HistoryController.

  • It calls Forward, and is disabled when there is nothing to go forward to: before any Back, and after a new navigation, which clears Forward. With no history installed it calls window.history.forward() and is never disabled.
  • After a reload with sessionStorage blocked, history cannot know how far Forward goes, so the button stays disabled. That is harmless.
  • dj-forward fires first and can be canceled. Call preventDefault() to do something else.
  • The label is "Forward". Set label to replace it. The accessible name always equals the visible label. With icon-only, only the arrow shows, the label becomes the accessible name, and a tooltip shows it on hover and focus. The arrow mirrors in right-to-left layouts.

Try it in the playground

@dojo-ng/nav-history · v0.2.0 · The same package also registers <dj-back-button>.

npm install @dojo-ng/nav-history

import "@dojo-ng/nav-history";

Properties

PropertyAttributeTypeDefault
labelReplaces the default label. label string None
iconOnlyShow only the arrow. The label is still the accessible name, and a tooltip shows it. icon-only reflected boolean false

Events

EventDescription
dj-forwardcancelable, empty detail

CSS parts

Style these with dj-forward-button::part(name).

PartDescription
buttonthe composed <dj-button>

Methods

focus(options: FocusOptions)blur()