include-fragment

back edit

Defer loading content to after load.

<include-fragment src="../../support/deferred_content.html" class="octocat-spinner">
</include-fragment>

Use include-fragment itself as a loading state.

<include-fragment src="/endless-spinner" class="octocat-spinner">
</include-fragment>

Use data-hide-on-error, data-show-on-error, and data-retry-button for fail paths.

<include-fragment src="/404">
  <div data-hide-on-error>Loading...</div>
  <div data-show-on-error hidden>
    Something went wrong.
    <button data-retry-button class="btn-link" type="submit">Retry.</button>
  </div>
</include-fragment>