Skip to content

SegmentedControl: add subtle variant and action slot - #8325

Draft
liuliu-dev wants to merge 13 commits into
mainfrom
liuliu/segmentedcontrol-add-subtle-and-action-slot
Draft

SegmentedControl: add subtle variant and action slot#8325
liuliu-dev wants to merge 13 commits into
mainfrom
liuliu/segmentedcontrol-add-subtle-and-action-slot

Conversation

@liuliu-dev

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

Copy link
Copy Markdown
Contributor

Closes https://github.com/github/primer/issues/6973

Adds a subtle variant and an optional action slot to SegmentedControl.

Changelog

New

  • Add variant="subtle" for lower-emphasis view selectors
subtle variant
  • Add SegmentedControl.Action for actions such as adding a new view.
add view action

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 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 414fc90

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 19, 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 requested a deployment to storybook-preview-8325 August 20, 2026 21:20 Abandoned
@primer-integration

primer-integration Bot commented Aug 20, 2026

Copy link
Copy Markdown

Integration test results from github/github-ui PR:

Passed  CI   Passed
Running  VRT   Running
Waiting  Projects   Waiting

@github-actions
github-actions Bot temporarily deployed to storybook-preview-8325 August 20, 2026 21:29 Inactive
@liuliu-dev
liuliu-dev marked this pull request as ready for review August 20, 2026 22:16
@liuliu-dev
liuliu-dev requested a review from a team as a code owner August 20, 2026 22:16
@liuliu-dev
liuliu-dev requested review from TylerJDev and a lite review from Copilot August 20, 2026 22:16

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

Adds new UI capabilities to SegmentedControl in @primer/react by introducing a lower-emphasis variant="subtle" and a new compound slot SegmentedControl.Action intended for trailing actions (e.g., “Add view”), with supporting styling, docs, Storybook examples, and tests.

Changes:

  • Added variant="subtle" styling and dividerBefore support for grouping segments visually.
  • Introduced SegmentedControl.Action and wired it into SegmentedControl via useSlots.
  • Updated docs/stories/tests and added a changeset for a minor release.
Show a summary per file
File Description
packages/react/src/SegmentedControl/SegmentedControlIconButton.tsx Adds dividerBefore prop and exposes it via data-divider-before.
packages/react/src/SegmentedControl/SegmentedControlButton.tsx Adds dividerBefore prop and exposes it via data-divider-before.
packages/react/src/SegmentedControl/SegmentedControlAction.tsx Adds new SegmentedControl.Action slot component (trailing action).
packages/react/src/SegmentedControl/SegmentedControl.tsx Supports subtle variant and extracts/renders the new Action slot via useSlots.
packages/react/src/SegmentedControl/SegmentedControl.test.tsx Adds tests for subtle variant, dividers, and action click behavior.
packages/react/src/SegmentedControl/SegmentedControl.module.css Implements subtle variant visuals, divider rendering, and action button sizing/hover styles.
packages/react/src/SegmentedControl/SegmentedControl.features.stories.tsx Adds feature stories for subtle variant and trailing action.
packages/react/src/SegmentedControl/SegmentedControl.features.stories.module.css Styles the reset button in the new feature story.
packages/react/src/SegmentedControl/SegmentedControl.docs.json Documents subtle, dividerBefore, and the new SegmentedControl.Action API.
packages/react/src/SegmentedControl/index.ts Exports SegmentedControlActionProps type.
.changeset/segmented-control-subtle-add-view.md Declares a minor bump for the new public API surface.

Review details

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

  • Files reviewed: 11/11 changed files
  • Comments generated: 5
  • Review effort level: Lite

Comment thread packages/react/src/SegmentedControl/SegmentedControlAction.tsx Outdated
Comment thread packages/react/src/SegmentedControl/SegmentedControlAction.tsx
Comment thread packages/react/src/SegmentedControl/SegmentedControl.module.css Outdated
Comment thread packages/react/src/SegmentedControl/SegmentedControl.tsx
Comment thread packages/react/src/SegmentedControl/SegmentedControl.module.css
@primer

primer Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint and formatting issues have been automatically fixed and committed to this PR.

@github-actions
github-actions Bot temporarily deployed to storybook-preview-8325 August 21, 2026 17:45 Inactive
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.

2 participants