feat(react-button): expose useSplitButtonBase_unstable base hook - #36524
Open
Victor Genaev (mainframev) wants to merge 5 commits into
Open
feat(react-button): expose useSplitButtonBase_unstable base hook#36524Victor Genaev (mainframev) wants to merge 5 commits into
Victor Genaev (mainframev) wants to merge 5 commits into
Conversation
|
Pull request demo site: URL |
Victor Genaev (mainframev)
force-pushed
the
feat/split-button-base-hook
branch
from
August 5, 2026 20:13
60cc5a7 to
afd18dd
Compare
Victor Genaev (mainframev)
force-pushed
the
feat/split-button-base-hook
branch
from
August 5, 2026 20:19
afd18dd to
60b51b8
Compare
Victor Genaev (mainframev)
force-pushed
the
feat/split-button-base-hook
branch
4 times, most recently
from
August 5, 2026 21:48
7b50ac1 to
9586fca
Compare
Victor Genaev (mainframev)
marked this pull request as ready for review
August 5, 2026 21:54
Tudor Popa (tudorpopams)
requested review from
Martin Hochel (Hotell),
PaulGMardling and
Dmytro Kirpa (dmytrokirpa)
and removed request for
Martin Hochel (Hotell)
August 6, 2026 12:07
Victor Genaev (mainframev)
force-pushed
the
feat/split-button-base-hook
branch
from
August 7, 2026 15:39
9586fca to
a5b57bb
Compare
Base automatically changed from
test/split-button-hook-regression-tests
to
master
August 7, 2026 20:28
…c base hook Splits SplitButton's internal logic into two layers: - useSplitButtonBase_unstable: design-agnostic base hook (no appearance/shape/ size), producing ARIA-wired root/menuButton/primaryActionButton slots with placeholder 'button' element metadata. - useSplitButton_unstable: styled wrapper that composes the base hook and recreates both child slots via slot.optional with the concrete Button/ MenuButton element types and styling defaults. Also widens renderSplitButton_unstable to accept SplitButtonBaseState so it can be reused directly by headless consumers instead of being duplicated. Adds SplitButtonBaseProps/SplitButtonBaseSlots/SplitButtonBaseState, exported from the SplitButton and package root barrels, together with a bundle-size fixture. This unblocks a future headless SplitButton built directly on the base hook.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Victor Genaev (mainframev)
force-pushed
the
feat/split-button-base-hook
branch
from
August 7, 2026 20:28
a5b57bb to
3f03d47
Compare
📊 Bundle size reportUnchanged fixtures
|
| @@ -0,0 +1,7 @@ | |||
| { | |||
There was a problem hiding this comment.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/Menu 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Menu.Nested Submenus Small Viewport Stacked.nested menu.chromium.png | 1008 | Changed |
| vr-tests-react-components/Menu.Nested Submenus Small Viewport Flipped.nested menu.chromium.png | 699 | Changed |
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png | 404 | Changed |
| vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png | 413 | Changed |
vr-tests-react-components/Positioning 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png | 747 | Changed |
| vr-tests-react-components/Positioning.Positioning end.chromium.png | 910 | Changed |
vr-tests-react-components/ProgressBar converged 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png | 110 | Changed |
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png | 160 | Changed |
vr-tests-react-components/TagPicker 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png | 658 | Changed |
| vr-tests-react-components/TagPicker.disabled.disabled input hover.chromium.png | 677 | Changed |
There were 2 duplicate changes discarded. Check the build logs for more information.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
PR 2 of a 3-PR stack. Base: #36523.
Extracts a design-agnostic
useSplitButtonBase_unstablebase hook (plusSplitButtonBaseProps/SplitButtonBaseSlots/SplitButtonBaseState) out of the styleduseSplitButton_unstable, so a future headlessSplitButton(PR 3) can compose the same behavior with headlessButton/MenuButtoninstead of the styled ones.Stack:
@fluentui/react-buttonbase-hook extractionfeat/split-button-headless— headlessSplitButton(base: this branch)What changed
SplitButton.types.ts: addedSplitButtonBaseSlots,SplitButtonBaseProps,SplitButtonBaseState— component-agnostic, typed againstButtonBaseProps/MenuButtonBasePropsinstead of concreteButton/MenuButton. Existing styled types (SplitButtonSlots/SplitButtonProps/SplitButtonState) are unchanged.useSplitButton.ts: addeduseSplitButtonBase_unstable, which owns all design-agnostic behavior (generated primary-action id,aria-labelledbyfallback naming, disabled/disabledFocusable propagation, icon propagation). RefactoreduseSplitButton_unstableto call the base hook and recreate both child slots viaslot.optionalwith the styledButton/MenuButtonelement types (production rendering resolves each slot's element type from itsSLOT_ELEMENT_TYPE_SYMBOLmetadata, not fromstate.components, so recreating rather than patchingstate.componentsis required).useSplitButtonBase.test.tsx(16 tests) for the new base contract.useSplitButtonBase.fixture.jsbundle-size fixture.react-button.api.md.No behavior change to the styled
SplitButton/useSplitButton_unstable— the regression tests added in #36523 continue to pass unmodified.