Skip to content

WEBDEV-8019 Add basic loading indicator#17

Merged
rebecca-shoptaw merged 14 commits into
mainfrom
webdev-8019-add-basic-loading-indicator
Jan 13, 2026
Merged

WEBDEV-8019 Add basic loading indicator#17
rebecca-shoptaw merged 14 commits into
mainfrom
webdev-8019-add-basic-loading-indicator

Conversation

@rebecca-shoptaw

@rebecca-shoptaw rebecca-shoptaw commented Jan 7, 2026

Copy link
Copy Markdown
Collaborator

As part of the migration of the ia-activity-indicator into the elements repo, we're first building the svg and CSS animations for the loading indicator and then expanding it into a more fully-featured ia-status-indicator that can show a loading, error, or success indicator depending on a mode property.

This PR simply builds the first basic loading indicator.

Comment thread package-lock.json
Comment thread src/elements/ia-loading-indicator/ia-loading-indicator-story.ts Outdated
@codecov-commenter

codecov-commenter commented Jan 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.16%. Comparing base (d272dd5) to head (69041f0).

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #17       +/-   ##
===========================================
+ Coverage   34.61%   45.16%   +10.54%     
===========================================
  Files           3        4        +1     
  Lines          26       31        +5     
  Branches        4        4               
===========================================
+ Hits            9       14        +5     
  Misses         15       15               
  Partials        2        2               

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rebecca-shoptaw rebecca-shoptaw force-pushed the webdev-8019-add-basic-loading-indicator branch from eab45ca to fd8e6d7 Compare January 8, 2026 18:17
Comment thread src/themes/theme-styles.ts
@nsharma123

nsharma123 commented Jan 9, 2026

Copy link
Copy Markdown

I looked into and conducted research for this particular loading. I found that SVG loading indicators shouldn’t rely on <title> or for assistive technology. Instead, the loading state should be communicated via an ARIA role on the container, such as role="status or role="progressbar".

The <title> / elements mainly create tooltips, which aren’t relevant for this use case. A better approach is to provide context using an ARIA label or a screen-reader-only text like Loading, please wait….

Since the loading state is already described textually, the SVG itself can be marked as decorative using aria-hidden="true".

Here is an example of what a loader SVG would look like.

<div
  class="circular-loading-indicator"
  role="status"
  aria-live="polite"
  aria-label="Loading, please wait"
>
  <span class="sr-only">Loading, please wait…</span>

  <svg
    viewBox="0 0 120 120"
    xmlns="http://www.w3.org/2000/svg"
    aria-hidden="true"
    focusable="false"
  >
  <!-- svg content -->
  </svg>
</div>

@rebecca-shoptaw

Copy link
Copy Markdown
Collaborator Author

Thanks @nsharma123! I'll do some more research myself (if you have sources for your research, that would be great) and look into switching out that title.

@rebecca-shoptaw

Copy link
Copy Markdown
Collaborator Author

I looked into and conducted research for this particular loading. I found that SVG loading indicators shouldn’t rely on <title> or for assistive technology. Instead, the loading state should be communicated via an ARIA role on the container, such as role="status or role="progressbar".

The <title> / elements mainly create tooltips, which aren’t relevant for this use case. A better approach is to provide context using an ARIA label or a screen-reader-only text like Loading, please wait….

Since the loading state is already described textually, the SVG itself can be marked as decorative using aria-hidden="true".

Thanks @nsharma123 ! I did some research in a11y resources and the MDN docs and determined that the best approach was to use the title element, which is specifically intended for SVG accessibility and the preferred method when no visible text describes the indicator (see: MDN docs on title), combined with the status role which automatically uses aria-live="polite" and is the most accurate representation of what the image is for (see: MDN docs on status).

Made both changes -- thanks for bringing this up and I'm excited to get more a11y work into this new repo.

Comment thread demo/app-root.ts
Comment thread demo/story-template.ts Outdated
Comment thread src/elements/ia-status-indicator/ia-status-indicator-story.ts Outdated
Comment thread src/elements/ia-status-indicator/ia-status-indicator-story.ts
Comment thread src/elements/ia-status-indicator/ia-status-indicator-story.ts Outdated

@jbuckner jbuckner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two comments (and can remove that light/dark switch), but looks good 👍

Comment thread demo/app-root.ts
Comment thread src/elements/ia-status-indicator/ia-status-indicator.ts
@rebecca-shoptaw rebecca-shoptaw force-pushed the webdev-8019-add-basic-loading-indicator branch from 7d48dcd to 69041f0 Compare January 13, 2026 18:23
@rebecca-shoptaw rebecca-shoptaw merged commit 9da74da into main Jan 13, 2026
1 check passed
@rebecca-shoptaw rebecca-shoptaw deleted the webdev-8019-add-basic-loading-indicator branch January 13, 2026 18:36
jbuckner added a commit that referenced this pull request Jan 26, 2026
* main:
  v0.1.0 (#26)
  WEBDEV-8109 Expand status indicator capabilities (#23)
  WEBDEV-8100 Encapsulate style settings (#22)
  Load snowflakes async (#12)
  WEBDEV-8019 Add basic loading indicator (#17)
  Fix issue with css property values not updating (#19)
  WEBDEV-8098: Component Demo Light Mode (#18)
  WEBDEV-8037 Create CSS theme structure (#16)
jbuckner added a commit that referenced this pull request Jan 29, 2026
* main:
  Update directory paths for GitHub Pages (#27)
  WEBDEV-8141: Github Pages (#25)
  v0.1.0 (#26)
  WEBDEV-8109 Expand status indicator capabilities (#23)
  WEBDEV-8100 Encapsulate style settings (#22)
  Load snowflakes async (#12)
  WEBDEV-8019 Add basic loading indicator (#17)
  Fix issue with css property values not updating (#19)
  WEBDEV-8098: Component Demo Light Mode (#18)
  WEBDEV-8037 Create CSS theme structure (#16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants