Skip to content

Examples

Upload with progress

An upload flow snapshotted mid-transfer, where a static progress value stands in for the live bar and a toast confirms the file that just finished.

Preview

Upload brand assets

PNG or SVG, up to 10 MB each.

3 of 5 files uploaded
wordmark.svg uploaded.
HTML
<bs:bsui-stack direction="column" gap="4" align="stretch">
  <bs:bsui-card>
    <bs:bsui-card-header>
      <bs:bsui-card-title label="Upload brand assets" />
      <bs:bsui-card-description label="PNG or SVG, up to 10 MB each." />
    </bs:bsui-card-header>
    <bs:bsui-card-content>
      <bs:bsui-stack direction="column" gap="3" align="stretch">
        <bs:bsui-file-upload name="assets" accept=".png,.svg" multiple="true" />
        <bs:bsui-progress value="68" max="100" label="Uploading hero-dark.png" />
        <bs:bsui-text content="3 of 5 files uploaded" variant="caption" tag="span" />
      </bs:bsui-stack>
    </bs:bsui-card-content>
  </bs:bsui-card>
  <bs:bsui-toast-provider position="bottom-right">
    <bs:bsui-toast message="wordmark.svg uploaded." />
  </bs:bsui-toast-provider>
</bs:bsui-stack>

How it works

Dropped files land in an upload queue in the store, and each finished transfer bumps the progress value and appends a toast through provider context. The bar label mirrors the active file name from state so the visible text and value always agree.

Every behaviour on this page is the WordPress Interactivity API: each component registers its own store, seeds its state in a server rendered context, and wires events with directives in the markup above. There is no page specific JavaScript.