Skip to content

notification indicator - #8311

Open
liuliu-dev wants to merge 3 commits into
mainfrom
liuliu/add-notification-indicator
Open

notification indicator#8311
liuliu-dev wants to merge 3 commits into
mainfrom
liuliu/add-notification-indicator

Conversation

@liuliu-dev

@liuliu-dev liuliu-dev commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Closes github/primer#6322

Adds a notificationIndicator prop to Button and IconButton for displaying new activity. The prop also supports placement variants so the indicator can appear on the control boundary or on the relevant visual:

  • Button: "button" or "leadingVisual"
  • IconButton: "button" or "icon"
indicator story

Changelog

New

  • Export notificationIndicator from @primer/react
  • Add a Button story demonstrating the indicator on Button and IconButton

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b4ca76e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions
github-actions Bot temporarily deployed to storybook-preview-8311 August 17, 2026 20:53 Inactive
@liuliu-dev
liuliu-dev marked this pull request as ready for review August 17, 2026 21:01
@liuliu-dev
liuliu-dev requested a review from a team as a code owner August 17, 2026 21:01
@liuliu-dev
liuliu-dev requested review from jonrohan and a lite review from Copilot August 17, 2026 21:01

Copilot AI 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.

Pull request overview

This PR introduces a reusable notificationIndicator utility class exported from @primer/react to render a small notification dot on interactive controls via a pseudo-element, plus a Storybook example and an accompanying changeset.

Changes:

  • Add NotificationIndicator.module.css and export a notificationIndicator class name utility.
  • Export notificationIndicator from the package entrypoint and update the exports snapshot.
  • Add a Button feature story demonstrating the indicator on Button and IconButton.
Show a summary per file
File Description
packages/react/src/NotificationIndicator/NotificationIndicator.module.css Adds the CSS Module styling for the notification dot pseudo-element.
packages/react/src/NotificationIndicator/index.ts Exposes the CSS Module class as the notificationIndicator export.
packages/react/src/index.ts Re-exports notificationIndicator from the package root.
packages/react/src/Button/Button.features.stories.tsx Adds a Storybook example applying the indicator to Button and IconButton.
packages/react/src/__tests__/__snapshots__/exports.test.ts.snap Updates the public-exports snapshot to include notificationIndicator.
.changeset/bright-dots-notify.md Declares a minor release for the new exported utility.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +5 to +9
position: absolute;
top: calc(var(--base-size-4) / -2);
right: calc(var(--base-size-4) / -2);
display: block;
width: var(--base-size-8);
@@ -0,0 +1,3 @@
import classes from './NotificationIndicator.module.css'

export const notificationIndicator = classes.NotificationIndicator

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.

I'm not aware of many classes we export like this. Would it be better to add a prop to appropriate components unread={true} or notification={true}?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point! I replaced the exported CSS class with a notificationIndicator prop on Button and IconButton.

@primer-integration

primer-integration Bot commented Aug 17, 2026

Copy link
Copy Markdown

Integration test results from github/github-ui PR:

Passed  CI   Passed
Running  VRT   Running
Waiting  Projects   Waiting

@liuliu-dev
liuliu-dev requested a review from jonrohan August 18, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants