Skip to content

feat(react-input): add useInputBase_unstable hook#35813

Merged
dmytrokirpa merged 3 commits into
masterfrom
feat/react-input-base-hooks
Mar 20, 2026
Merged

feat(react-input): add useInputBase_unstable hook#35813
dmytrokirpa merged 3 commits into
masterfrom
feat/react-input-base-hooks

Conversation

@dmytrokirpa

@dmytrokirpa dmytrokirpa commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds InputBaseProps type derived from InputProps by omitting design props (appearance, size)
  • Adds InputBaseState type derived from InputState by omitting the same design props
  • Adds useInputBase_unstable hook that handles:
    • Controlled/uncontrolled value state via useControllableState
    • onChange event handling with the InputOnChangeData callback signature
    • Slot structure: root (span wrapper), input (the actual input element), contentBefore and contentAfter optional slots
    • Native prop partitioning between root and input slots
  • Refactors useInput_unstable to call useInputBase_unstable and spread its results, then add appearance and size
  • Note: contentBefore/contentAfter are user-provided optional slots (not default implementations), so they remain in the base hook
  • Exports new types and hook from packages/react-components/react-input/library/src/index.ts

What base hooks do

Base hooks extract pure component logic — ARIA, keyboard handling, slot structure — WITHOUT styling, design props, or default slot implementations. This allows consumers to build custom-styled variants without taking on the full FluentUI design system.

🤖 Generated with Claude Code

dmytrokirpa and others added 2 commits March 5, 2026 11:53
Adds InputBaseProps, InputBaseState types and useInputBase_unstable hook to the react-input package.
The base hook handles controlled/uncontrolled value state, onChange handling, and slot structure
(root span, input, contentBefore, contentAfter) without design-specific props (appearance, size).
The styled useInput_unstable hook is refactored to call the base hook and spread its results.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@dmytrokirpa dmytrokirpa changed the base branch from experimental/component-base-hooks to master March 5, 2026 10:53
@dmytrokirpa dmytrokirpa force-pushed the feat/react-input-base-hooks branch from feba8ec to 8027fcd Compare March 5, 2026 10:53
@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown

Pull request demo site: URL

@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.292 MB
323.336 kB
1.293 MB
323.341 kB
33 B
5 B
react-datepicker-compat
DatePicker Compat
225.125 kB
63.619 kB
225.158 kB
63.633 kB
33 B
14 B
react-input
Input
26.246 kB
8.688 kB
26.28 kB
8.702 kB
34 B
14 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
70.397 kB
19.96 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
236.62 kB
68.716 kB
react-components
react-components: FluentProvider & webLightTheme
43.612 kB
14.022 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-timepicker-compat
TimePicker
108.174 kB
35.695 kB
🤖 This report was generated against 55ade976605866015dbc1d8b629513bc7515e1fe

@dmytrokirpa dmytrokirpa force-pushed the feat/react-input-base-hooks branch from fe74c41 to 0661d95 Compare March 18, 2026 19:52
@dmytrokirpa dmytrokirpa self-assigned this Mar 18, 2026
@dmytrokirpa dmytrokirpa marked this pull request as ready for review March 18, 2026 19:52
@dmytrokirpa dmytrokirpa requested a review from a team as a code owner March 18, 2026 19:52
@dmytrokirpa dmytrokirpa requested a review from mainframev March 19, 2026 16:36
@dmytrokirpa dmytrokirpa merged commit cd15922 into master Mar 20, 2026
15 checks passed
tudorpopams pushed a commit to tudorpopams/fluentui that referenced this pull request Apr 14, 2026
@dmytrokirpa dmytrokirpa deleted the feat/react-input-base-hooks branch May 23, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants