Skip to content

docs(badge): register icons in the JavaScript tab bar playground - #4848

Merged
brandyscarney merged 2 commits into
mainfrom
docs/js-examples-add-icons
Nov 13, 2026
Merged

brandyscarney merged 2 commits into
mainfrom
docs/js-examples-add-icons

Conversation

@brandyscarney

Copy link
Copy Markdown
Member

What is the current behavior?

When the JavaScript version of the Badges in Tab Buttons example (on the Tab Bar and Badge pages) is opened in StackBlitz, the icons don't load. The example uses <ion-icon name="..."> without registering the icons, so Ionicons tries to fetch /svg/heart.svg and the other icons. In the StackBlitz project, those requests return index.html instead of the SVG.

The other JavaScript examples that use icons don't have this problem because they include an index.ts that registers their icons with addIcons.

What is the new behavior?

  • The v8 and v9 badge/inside-tab-bar JavaScript example is now split into javascript/index_html.md and javascript/index_ts.md, matching button/icons. The index.ts registers calendar, heart and musicalNote with addIcons.
  • Removed the unused javascript.md files from the v8 and v9 reorder/custom-icon and fab/theming/css-shadow-parts examples. Those examples already load javascript/index_html.md and javascript/index_ts.md.

Testing

Loaded the new files into the v9 JavaScript StackBlitz template locally and opened it in headless Chrome. All three icons rendered, and no requests were made to /svg/.

The JavaScript "Badges in Tab Buttons" example used ion-icon names without
registering them, so StackBlitz fetched /svg/*.svg and the icons did not
load. Split it into index.html and index.ts and register the icons with
addIcons, matching the other JavaScript examples.

Also remove unused javascript.md files from the reorder custom-icon and
fab css-shadow-parts examples, which already load javascript/index_html.md
and javascript/index_ts.md.
@brandyscarney
brandyscarney requested a review from a team as a code owner November 13, 2026 17:47
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-docs Ready Ready Preview Nov 13, 2026 5:51pm UTC

Request Review

@brandyscarney brandyscarney changed the title docs(badge): register icons in the JavaScript tab bar playground docs(tab-bar): register icons in the JavaScript bages playground Nov 13, 2026
@brandyscarney brandyscarney changed the title docs(tab-bar): register icons in the JavaScript bages playground docs(badge): register icons in the JavaScript tab bar playground Nov 13, 2026

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@brandyscarney
brandyscarney merged commit b494861 into main Nov 13, 2026
7 checks passed
@brandyscarney
brandyscarney deleted the docs/js-examples-add-icons branch November 13, 2026 19:17

This branch was successfully deployed

1 active deployment
Preview — a0a67b26 Deployed Nov 13, 2026 by vercel[bot]
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.

2 participants