BluKavantUI Design system
PATTERNS

Loading & feedback

Reserve space, explain progress, and make the next action clear.

LOADING & FEEDBACK / IMPLEMENTATION RECIPE

An empty result is not a failed request.

Build an asynchronous request region that distinguishes loading, ready, empty, failed and stale data. Retry stays available, and a failed refresh can keep the last successful result visible.

Use a Skeleton when you know the shape of the incoming content. Use measured progress for uploads or exports with known totals. Reserve a full-screen blocker for work that really blocks the whole screen.

REQUEST STARTEDLoadingaria-busy=true
Rows returnedReady · show records
Zero rowsEmpty · explain the result
Request rejectedError · retry, or retain stale rows
WORKING COMPOSITION

Ready, empty, first-load error and failed-refresh states with request-race protection.

Real BluKavantUI components, with a small application controller. Data and save responses are simulated in this page; reload resets the example.

Loading the interactive recipe…

Try this sequence
  1. Leave Next response as Three requests and choose Load requests. A skeleton is replaced by three rows.
  2. Choose Failed request, then Retry requests. The previous rows remain with an explicit stale-result message.
  3. Choose Empty result and retry. You get a completed empty state, not an endless loader.
  4. Start one request, change the outcome and immediately restart. Only the newest request may update the region.
IMPLEMENT THE WORKFLOW

Build loading & feedback into your application.

Skeleton ↗

Reserves space during the first request.

EmptyState ↗

Explains a successful empty result or a failed initial request.

Application status region

Announces the result and exposes retry without stealing focus.

  1. Model the request, not a boolean

    Keep the last accepted rows separately from loading and error state. Null means not loaded; [] means a successful empty response.

  2. Reserve the right area

    Show placeholders only in the loading region. Put one live status outside its aria-busy subtree; decorative skeleton shapes should not be individually announced.

  3. Guard response order

    Use an AbortController and request sequence. Cancellation reduces work; the sequence guard also protects against services that finish despite cancellation.

  4. Design a useful retry

    A failed first load shows an error and retry. A failed refresh retains the previous rows with a clear stale notice. Retry uses the same query context.

State / contractImplementation
Load portload(signal: AbortSignal): Promise<RequestRow[]>. Reject for failure; return [] for a successful empty result.
Request identityIncrement a sequence number on every request; only the active sequence may update content, status or aria-busy.
Busy regionaria-busy=true while pending, then false for every settled active outcome.
Accepted snapshotKeep rows from the last success. A refresh error does not silently label old data as current.

Web implementation

Call mount(host, loadRequests). Wire loadRequests to your API and pass the AbortSignal into fetch. Check response.ok before parsing. The returned refresh() starts a request; destroy() aborts pending work and destroys mounted components. This demo uses a deterministic delayed adapter so you can exercise every outcome.

Install Community and the required Pro add-on for Grid or Kanban recipes, import @blukavantui/community/styles.css, and use a connected host element. The companion CSS styles the surrounding fields, navigation and status messages.

Keep the recipe and shared.ts together; TypeScript resolves the recipe’s ./shared.js import. Add class="recipe-demo" to your host. Supply your records and backend callback as the mount arguments. The downloads use Community 1.0.0 and Pro 1.0.0 imports; the live demo retains its previously verified SDK 0.9.0 runtime.

View the TypeScript recipe
import { createSkeleton } from '@blukavantui/community/skeleton';
import { createEmptyState } from '@blukavantui/community/empty-state';
import { node, button, status } from './shared.js';
export interface RequestRow { id: string; title: string }
export function mount(host: HTMLElement, load: (signal: AbortSignal) => Promise<RequestRow[]>) {
  const retry = button('Load requests', () => { void refresh(); });
  const region = node('section', '', 'recipe-load-region'); region.setAttribute('aria-label', 'Requests');
  host.append(retry, region); const message = status(host);
  let rows: RequestRow[] | null = null, serial = 0, disposed = false, abort: AbortController | undefined;
  let view: { destroy(): void } | undefined;
  function clear() { view?.destroy(); view = undefined; region.replaceChildren(); }
  function showRows() {
    clear(); const list = node('ul', '', 'recipe-loaded-list');
    for (const row of rows || []) list.append(node('li', `${row.id} · ${row.title}`));
    region.append(list);
  }
  async function refresh() {
    abort?.abort(); abort = new AbortController(); const request = ++serial;
    retry.textContent = 'Restart request'; region.setAttribute('aria-busy', 'true'); message.textContent = 'Loading requests…';
    if (rows === null) {
      clear(); const placeholder = node('div'); placeholder.setAttribute('aria-hidden', 'true'); region.append(placeholder);
      view = createSkeleton(placeholder, { Shape: 'Rectangle', Width: '100%', Height: '160px' });
    }
    try {
      const result = await load(abort.signal);
      if (disposed || request !== serial) return; rows = result; clear();
      if (rows.length) showRows();
      else view = createEmptyState(region, { Title: 'No requests yet', Description: 'The request completed successfully. Your queue is empty.', Kind: 'Empty' });
      message.textContent = rows.length ? `${rows.length} requests loaded.` : 'No requests to display.';
    } catch {
      if (disposed || request !== serial) return;
      if (rows?.length) { showRows(); message.textContent = 'Refresh failed. Showing the previous result; try again.'; }
      else {
        clear(); view = createEmptyState(region, { Title: 'Requests could not be loaded', Description: 'Choose Retry requests to try again.', Kind: 'Error' });
        message.textContent = 'Request failed. You can retry.';
      }
    } finally {
      if (!disposed && request === serial) { region.setAttribute('aria-busy', 'false'); retry.textContent = 'Retry requests'; }
    }
  }
  message.textContent = 'Choose an outcome above, then load the requests.';
  return { refresh, destroy() { disposed = true; serial++; abort?.abort(); clear(); host.replaceChildren(); } };
}

OutSystems implementation

Use Skeleton from BluKavantUi_Community_Core and EmptyState from BluKavantUi_Community_Feedback in either edition. Compose them with native Containers, an If and a Retry button. These Blocks provide presentation; the consumer owns the data-fetch state.

Binding / handlerImplementation
Screen variablesIsLoading, HasLoaded, HasError, ActiveRequestNumber, ErrorMessage and the last accepted Rows list. Keep HasLoaded separate from Rows.Empty.
Start loadIncrement ActiveRequestNumber and capture it in the handler. Set IsLoading=True and HasError=False, then call your authorized data action with the current filters.
Accept responseOnly apply it if the captured number still equals ActiveRequestNumber. Assign Rows, HasLoaded=True and IsLoading=False; empty Rows is a valid result.
Handle failureFor the active request, set HasError=True and IsLoading=False. Preserve previously accepted Rows. Offer Retry with the current query values.
PresentationUse Skeleton before the first result, EmptyState for empty/error content, and a visible stale notice beside existing rows after a refresh failure. Add aria-busy to the region and one external role=status message.

Add these native Blocks to your consumer Screen, bind the listed events and connect your application actions. The interactive example above runs the web implementation.

Open the full native Skeleton API →
AVOID THESE FAILURES

What breaks this workflow

Empty means keep loading

An empty array is a finished result. Stop the skeleton and explain the empty state.

The oldest response wins

Two fetches can finish out of order. Guard success, failure and finally paths with the same request ID.

Toast-only failure

Transient notifications can disappear before retry is possible. Keep an actionable message with the affected region.

BEFORE YOU SHIP

Verify the behavior, including recovery.

  • Every successful, empty and failed active request clears aria-busy.
  • A fast second request cannot be overwritten by the first response.
  • Failed refresh leaves old data visibly marked as stale.
  • Status changes are announced once; focus stays on the user’s control and retry is keyboard accessible.

Use the linked component accessibility notes when reviewing focus, keyboard behavior and status announcements in your implementation.

All patterns →

Search BluKavantUI