Skip to content

feat: Support labelTag for inline Token - #5090

Open
NathanZlion wants to merge 11 commits into
mainfrom
dev-v3-natidere-token-additions
Open

NathanZlion wants to merge 11 commits into
mainfrom
dev-v3-natidere-token-additions

Conversation

@NathanZlion

@NathanZlion NathanZlion commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Description

Inline tokens now render labelTag. Normal tokens already showed it through the shared Option layout, but the inline variant dropped it. This lets teams show a trailing value such as a coverage percentage (labelTag="17%") in both variants without a new prop.

No new props are added.

How to test

  1. Open #/light/token/permutations.
  2. The inline rows now include tokens with and without label-tag, combined with icon, dismiss, read-only and disabled.

How has this been tested?

  • gulp build passes locally
  • Token unit tests pass, including new labelTag tests for the normal and inline variants
  • Documenter snapshot updated for the variant description

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.70%. Comparing base (3b62c18) to head (e49eb51).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5090   +/-   ##
=======================================
  Coverage   97.70%   97.70%           
=======================================
  Files         990      990           
  Lines       31818    31821    +3     
  Branches    11752    11754    +2     
=======================================
+ Hits        31089    31092    +3     
  Misses        722      722           
  Partials        7        7           

☔ View full report in Codecov by Harness.
📢 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.

@NathanZlion NathanZlion changed the title feat: Add prefix and secondaryText to Token feat: Support labelTag for inline Token Oct 5, 2026
@NathanZlion
NathanZlion requested a review from jperals October 6, 2026 13:14
@NathanZlion
NathanZlion marked this pull request as ready for review October 6, 2026 13:14
@NathanZlion
NathanZlion requested a review from a team as a code owner October 6, 2026 13:14
@NathanZlion
NathanZlion removed the request for review from a team October 6, 2026 13:52
Comment thread pages/token/permutations.page.tsx
Comment thread src/token/internal.tsx
@@ -124,6 +124,7 @@ function InternalToken({
return {
...labelObject,
disabled,
labelTag,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is no visual distinction between the "main" label and the label tag (other than being aligned on opposite ends). Is this the intended design?

Image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

confirmed this with design, this is expected. if there's a need for visual difference like a font size difference or text color difference is needed and the need arises from customers we can follow up with it. Our current usecase:
Image

Comment thread src/token/interfaces.ts Outdated
@@ -39,7 +39,7 @@ export interface TokenProps extends BaseComponentProps {
/**
* Specifies the token's visual style and functionality.
*
* For `inline` only label, icon and dismiss button are displayed.
* For `inline` only label, label tag, icon and dismiss button are displayed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At this point, looks like the props that are displayed are more than those that aren't. Also, I think this text could be written a bit more clearly. What do you think about something like this:

When variant="inline", only label, label tag, icon and dismiss button are displayed. Description and tags are not.

("variant="inline"" is consistent with the comment for the icon prop)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

("variant="inline"" is consistent with the comment for the icon prop)

Although this is the doc for the variant prop itself, so no need to be so verbose in this part. What about something like

When set to inline, only label, label tag, icon and dismiss button are displayed. Description and tags are not.

@NathanZlion NathanZlion Oct 7, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

makes sense, updated it.

This branch was successfully deployed

3 active deployments
dev-pages-react18 — e49eb518 Deployed Oct 8, 2026 by NathanZlion via deploy (React 18) / deploy #2631
dev-pages-react16 — e49eb518 Deployed Oct 8, 2026 by NathanZlion via deploy (React 16) / deploy #2631
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