API reference up.status
module

Features to show which request is loading and which link leads to the current page.

While a request is loading, the origin element that triggered it gets an .up-active class and the targeted fragments get .up-loading. For richer loading state, a link or form can show an [up-placeholder] inside the fragment it targets, or name an [up-preview] function registered with up.preview(). A preview can change the page in any way, up to rendering the expected result before the server confirms it. Every effect is reverted when the request ends.

Within an [up-nav] container, links pointing to the current location are marked .up-current, and the class moves as the user navigates.


Features

  • While rendering, the .up-active class is added to the origin element that triggered the change.

  • [up-alias] ATTR

    Links within navigational containers may use the [up-alias] attribute to define alternative URLs for which they should also be highlighted as .up-current.

  • When a link within a navigational container points to the current location, it is assigned the .up-current class.

  • While rendering, all targeted fragments are assigned the .up-loading class.

  • [up-nav] ATTR

    Marks this element as a navigational container, such as a menu or navigation bar.

  • [up-placeholder] ATTR experimental

    Links or forms can define a placeholder that will be shown within the targeted fragment while loading content from the server.

  • Registers a named preview function.

  • Links or forms can name a preview function that is called while loading content from the server.

  • .up-revalidating CSS experimental

    While revalidating content rendered from a stale cache entry, all targeted fragments are assigned the .up-revalidating class.

  • Sets default options for status effects.