feat(react-headless-components-preview): add headless SplitButton - #36525
Open
mainframev wants to merge 2 commits into
Open
feat(react-headless-components-preview): add headless SplitButton#36525mainframev wants to merge 2 commits into
mainframev wants to merge 2 commits into
Conversation
|
Pull request demo site: URL |
mainframev
force-pushed
the
feat/split-button-headless
branch
2 times, most recently
from
August 5, 2026 20:17
5e4080e to
1729fa7
Compare
mainframev
force-pushed
the
feat/split-button-headless
branch
2 times, most recently
from
August 5, 2026 20:32
df877af to
62beaec
Compare
mainframev
force-pushed
the
feat/split-button-headless
branch
3 times, most recently
from
August 5, 2026 21:29
94e9f32 to
43f0c90
Compare
mainframev
force-pushed
the
feat/split-button-headless
branch
from
August 5, 2026 21:32
43f0c90 to
314810d
Compare
mainframev
force-pushed
the
feat/split-button-headless
branch
from
August 5, 2026 21:50
314810d to
bc760d3
Compare
mainframev
marked this pull request as ready for review
August 5, 2026 21:54
Composes the design-agnostic useSplitButtonBase_unstable from @fluentui/react-button with the existing headless Button and MenuButton primitives to expose a stable, unstyled SplitButton. - SplitButton, useSplitButton, renderSplitButton, and the SplitButtonProps/ SplitButtonSlots/SplitButtonState types are re-exported/aliased from the base API introduced in @fluentui/react-button (no appearance/size/shape). - The wrapper adds no SplitButton-specific data-* attributes; the nested headless Button and MenuButton remain the state owners. - Adds the ./split-button package export, bundle-size fixture entry, API report, unit tests, and a Storybook story composing the real headless Menu family via MenuTrigger's render-prop pattern.
…unstable from @fluentui/react-button
Mirrors the existing Button/MenuButton pattern
(export { renderX_unstable as renderX } from '@fluentui/react-button')
instead of duplicating the render body now that renderSplitButton_unstable
accepts SplitButtonBaseState.
mainframev
force-pushed
the
feat/split-button-headless
branch
from
August 5, 2026 21:56
bc760d3 to
a9bc5b3
Compare
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 3 of a 3-PR stack. Base: #36524.
Adds a stable, unstyled
SplitButtonprimitive to@fluentui/react-headless-components-preview, composing theuseSplitButtonBase_unstablebase hook introduced in #36524 with the existing headlessButtonandMenuButtonprimitives.Stack:
@fluentui/react-buttonbase-hook extractionSplitButtonWhat changed
library/src/components/SplitButton/:SplitButton.tsx,useSplitButton.ts,renderSplitButton.tsx,SplitButton.types.ts,index.ts.SplitButtonProps/SplitButtonSlots/SplitButtonStateare aliased directly from the base types exported by@fluentui/react-button(noappearance/size/shape).useSplitButtoncomposesuseSplitButtonBase_unstableand recreates both child slots with the headlessButton/MenuButtonviaslot.optional(not by patchingstate.components), so the headlessMenuButtonsupplies no default menu icon — consumers provide their own via themenuIconslot.data-*attributes; the nested headlessButton/MenuButtonremain the sole owners ofdata-disabled,data-disabled-focusable, anddata-icon-only.library/src/split-button.ts.library/package.json: added the./split-buttonexport map entry (alphabetized).library/bundle-size/AllComponents.fixture.js: added theSplitButtonimport/reference (alphabetized).SplitButton.test.tsx(22 tests):isConformant, default render, ref forwarding, no default menu icon, custommenuIcon,aria-labelledbyfallback, disabled/disabledFocusable propagation to children (not the wrapper), per-slot overrides, and resolved child slot metadata pointing at the headlessButton/MenuButton.stories/src/SplitButton/) composing the real headlessMenu/MenuTrigger/MenuPopover/MenuList/MenuItemfamily viaMenuTrigger's render-prop pattern, styled with CSS Modules and the stories' token variables only. Manually verified in a built Storybook: primary action fires independently, menu opens/closes (aria-expanded, Escape), and both interactions are independent.split-button.api.md.