feat(react-search): add useSearchBoxBase_unstable hook#35825
Merged
Conversation
Implements useSearchBoxBase_unstable hook for the SearchBox component that extracts pure component logic (controlled/uncontrolled value state, focus tracking, dismiss button click handling, search icon slot, type=search input) without design props (size, appearance). The styled hook useSearchBox_unstable now delegates to the base hook and adds size and appearance. Adds SearchBoxBaseProps and SearchBoxBaseState types using DistributiveOmit, omitting appearance and size from SearchBoxProps/SearchBoxState. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
6e2444a to
9e468a9
Compare
|
Pull request demo site: URL |
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
📊 Bundle size report
Unchanged fixtures
|
1 task
ValentinaKozlova
approved these changes
Mar 23, 2026
tudorpopams
pushed a commit
to tudorpopams/fluentui
that referenced
this pull request
Apr 14, 2026
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
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
useSearchBoxBase_unstablehook that extracts the core SearchBox logic without design props (size,appearance)SearchBoxBasePropsandSearchBoxBaseStatetypes usingDistributiveOmituseSearchBox_unstableto delegate to the base hook, then addsizeandappearanceindex.ts, barrel file, and packageindex.tsWhat the base hook manages
useControllableState)focusedstate,onFocus/onBlurcallbacks viasearchBoxRootRef)onChange, restores focus)type="search"input viauseInput_unstablecontentBeforewithSearchRegulardefault)role="button"andaria-label="clear"Design props excluded from base hook
size'small'/'medium'/'large'input sizeappearance'outline'/'underline'/'filled-darker'/ etc.🤖 Generated with Claude Code