DocsPage behavior reference
On this page

Loading attributes reference

Set loading text, attributes and interaction states.

Before you begin: Validation reference.

Loading Attributes

Frontbacked automatically locks the element that triggered an FQL event while a Frontbacked network request is pending. The locked element receives frontbacked-loading, and repeated events from that same element are ignored until the request returns.

For onsubmit state bindings, Frontbacked calls preventDefault() before your handler runs, so bound forms do not reload the page while async handlers are waiting. Each submission clears the form’s previous field messages and bound result before running your handler. Validating an object or array also clears earlier messages on its child fields. Other forms keep their own feedback.

After a successful record save, show a clear confirmation before navigating away:

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

Frontbacked.alert(message, title, type) opens a modal and resolves when dismissed. The page behind it stays in place until it closes.

index.html
AttributePurpose
f-loading-textTemporary innerText while the request is pending.
f-loading-attr-XTemporary attribute value while loading, where X is the HTML attribute name.
f-loading="off"Opts the trigger out of Frontbacked loading UI and re-entrancy locking. The request still runs.

Frontbacked restores the previous text, attributes, disabled state, and class after the request finishes.

Older themes may still use f-loading-disabled="true" for the same opt-out behavior, but new themes should use f-loading="off".

Data that is still loading

Lists and $posts values declared in page state report their progress in $status.<statePath>, whether or not they are .live:

StatusMeaning
loadingThe value is on its way, for the first time or after its selection changed.
readyThe value has been answered at least once.
errorWhy the latest request failed, or null.

While a list is loading, its f-list shows placeholder rows shaped like its template. Show an empty state only once the list has answered, so a visitor never reads "No accounts yet" while their accounts are still arriving:

index.html

Lists saved in site settings work the same way through $lists.<listId>.ready, which becomes true when the page receives its settings. If a list cannot load, it shows a short message with its own Try again button in place of its rows.

While a value's first answer is on its way, everything bound to it waits with it:

  • an f-text bound to it shows a placeholder bar;
  • an input, select or button with an f-attr-* bound to it, or whose event changes or reads it, is disabled, marked aria-busy, and shown as a placeholder;
  • the submit buttons of a form holding such a field wait as well;
  • state defined from it (for example "accountType($state.selected.data.accountType)") waits too.

Controls that do not depend on it, such as navigation, search and sign out, stay usable. Only the first load counts: refreshes and live updates leave controls usable. A control the page disabled itself stays disabled, a value that fails to load releases its controls, and f-loading="off" or f-no-skeleton keeps an element out of this behaviour.

Show a section while its data loads, so its placeholders are visible, rather than hiding it until the data arrives:

index.html

Values that your own JavaScript loads report the same way:

js

Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →

Continue with Component imports reference.