Skip to content

feat(react-base-components): add a new package to export Fluent UI base state hooks and render functions#35931

Open
dmytrokirpa wants to merge 14 commits intomicrosoft:masterfrom
dmytrokirpa:feat/export-base-hooks-from-suite
Open

feat(react-base-components): add a new package to export Fluent UI base state hooks and render functions#35931
dmytrokirpa wants to merge 14 commits intomicrosoft:masterfrom
dmytrokirpa:feat/export-base-hooks-from-suite

Conversation

@dmytrokirpa
Copy link
Copy Markdown
Contributor

@dmytrokirpa dmytrokirpa commented Mar 31, 2026

Summary

Introduces @fluentui/react-base-components — a new opt-in package that exposes the unstyled base layer of Fluent UI v9 components: behavior logic, accessibility patterns, and semantic slot structure, without any styling opinions.

This is aimed at teams building custom design systems that diverge significantly from Fluent 2. For most teams, the default styled components in @fluentui/react-components remain the recommended path.

What this package provides

  • Component behavior, structure, and ARIA patterns (WAI-ARIA authoring practices)
  • Keyboard handling identical to styled counterparts
  • Semantic slot structure
  • Base hooks and render functions for each component, exported under stable aliases (e.g. useButton instead of useButton_unstable)
  • Re-exports of foundational utilities from @fluentui/react-utilities and @fluentui/react-shared-contexts
  • composeComponent utility to compose a component from a base hook + render function

What this package does NOT provide

  • Design props (appearance, size, shape, etc.)
  • Style logic (Griffel, design tokens)
  • Motion logic (animations, transitions)
  • Default slot implementations (icons, sub-components)

Note: Base hooks provide ARIA attributes and semantic structure, but not visual accessibility (e.g. focus indicators, sufficient contrast). Consumers are responsible for implementing these in their custom styles.

Components included

Component Hooks Render function(s)
Accordion useAccordion, useAccordionItem, useAccordionHeader, useAccordionPanel renderAccordion, renderAccordionItem, renderAccordionHeader, renderAccordionPanel
Badge useBadge, usePresenceBadge, useCounterBadge renderBadge
Breadcrumb useBreadcrumb, useBreadcrumbDivider, useBreadcrumbItem, useBreadcrumbButton renderBreadcrumb, renderBreadcrumbDivider, renderBreadcrumbItem, renderBreadcrumbButton
Button useButton, useToggleButton renderButton_unstable, renderToggleButton_unstable
Card useCard, useCardFooter, useCardHeader, useCardPreview renderCard_unstable, renderCardFooter_unstable, renderCardHeader_unstable, renderCardPreview_unstable
Divider useDivider renderDivider_unstable
Image useImage renderImage_unstable
Input useInput renderInput_unstable
Link useLink renderLink_unstable
Persona usePersona renderPersona
Radio useRadioGroup, useRadio renderRadioGroup_unstable, renderRadio_unstable
Rating useRating, useRatingDisplay, useRatingItem renderRating_unstable, renderRatingDisplay_unstable, renderRatingItem_unstable
SearchBox useSearchBox renderSearchBox_unstable
Skeleton useSkeleton, useSkeletonItem renderSkeleton_unstable, renderSkeletonItem_unstable
Slider useSlider renderSlider_unstable
SpinButton useSpinButton renderSpinButton_unstable
Spinner useSpinner renderSpinner_unstable
Switch useSwitch renderSwitch_unstable
Textarea useTextarea renderTextarea_unstable

Package changes

  • New package @fluentui/react-base-components with full setup (build, tests, stories, bundle-size fixture, API report)
  • Upstream packages updated to expose base hooks/render functions needed for re-export:
    • @fluentui/react-breadcrumb — exports renderBreadcrumb_unstable and sub-component render functions
    • @fluentui/react-button — render function signature alignment
    • @fluentui/react-rating — exports base context values hook
    • @fluentui/react-skeleton — exports base hooks and render functions
    • @fluentui/react-textarea — render function signature alignment
  • Storybook stories added for all 20 components
  • Package registered in public-docsite-v9

Related Issue(s)

@dmytrokirpa dmytrokirpa self-assigned this Mar 31, 2026
@dmytrokirpa dmytrokirpa force-pushed the feat/export-base-hooks-from-suite branch from 2da26f5 to 1502ffe Compare March 31, 2026 15:53
@github-actions github-actions bot added the CI label Mar 31, 2026
@dmytrokirpa dmytrokirpa force-pushed the feat/export-base-hooks-from-suite branch 2 times, most recently from a0b20cb to 4118175 Compare March 31, 2026 15:55
@dmytrokirpa dmytrokirpa changed the title feat(react-components): add separate entrypoint for Fluent UI base state hooks feat(react-base-components): add a new package to export Fluent UI base state hooks and render functions Mar 31, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-base-components
react-base-components: entire library
0 B
0 B
228.53 kB
68.897 kB
🆕 New entry
react-breadcrumb
@fluentui/react-breadcrumb - package
115.355 kB
31.542 kB
115.403 kB
31.547 kB
48 B
5 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react
ActivityItem
71.22 kB
23.347 kB
react
Announced
38.472 kB
13.275 kB
react
Autofill
15.42 kB
4.766 kB
react
Breadcrumb
200.805 kB
59.601 kB
react
Button
194.354 kB
55.886 kB
react
ButtonGrid
179.242 kB
53.891 kB
react
Calendar
121.162 kB
36.83 kB
react
Callout
84.299 kB
27.593 kB
react
Check
53.206 kB
17.835 kB
react
Checkbox
59.978 kB
19.874 kB
react
ChoiceGroup
65.488 kB
21.465 kB
react
ChoiceGroupOption
58.769 kB
19.353 kB
react
Coachmark
92.7 kB
29.305 kB
react
Color
7.789 kB
3.127 kB
react
ColorPicker
134.97 kB
42.125 kB
react
ComboBox
250.687 kB
71.515 kB
react
CommandBar
201.861 kB
59.387 kB
react
ContextualMenu
154.229 kB
47.566 kB
react
DatePicker
183.251 kB
55.892 kB
react
DateTimeUtilities
5.244 kB
1.849 kB
react
DetailsList
229.929 kB
65.81 kB
react
Dialog
210.16 kB
62.358 kB
react
Divider
19.588 kB
6.84 kB
react
DocumentCard
215.843 kB
63.666 kB
react
DragDrop
8.343 kB
2.724 kB
react
DraggableZone
34.28 kB
11.488 kB
react
Dropdown
233.151 kB
67.962 kB
react
ExtendedPicker
96.823 kB
27.866 kB
react
Fabric
41.728 kB
14.343 kB
react
Facepile
209.377 kB
62.375 kB
react
FloatingPicker
240.865 kB
68.222 kB
react
FocusTrapZone
16.99 kB
5.891 kB
react
FocusZone
55.1 kB
17.451 kB
react
Grid
179.242 kB
53.891 kB
react
GroupedList
135.035 kB
40.67 kB
react
GroupedListV2
122.659 kB
37.758 kB
react
HoverCard
96.784 kB
30.688 kB
react
Icon
51.887 kB
17.263 kB
react
Icons
66.339 kB
24.385 kB
react
Image
46.901 kB
15.695 kB
react
Keytip
81.301 kB
26.677 kB
react
KeytipData
14.05 kB
4.583 kB
react
KeytipLayer
103.089 kB
31.9 kB
react
Keytips
105.873 kB
32.904 kB
react
Label
38.324 kB
13.241 kB
react
Layer
48.089 kB
16.348 kB
react
Link
39.665 kB
13.653 kB
react
List
39.346 kB
12.454 kB
react
MarqueeSelection
74.49 kB
22.402 kB
react
MessageBar
189.388 kB
56.33 kB
react
Modal
93.738 kB
30.223 kB
react
Nav
186.825 kB
55.723 kB
react
OverflowSet
33.354 kB
11.282 kB
react
Overlay
40.885 kB
14.077 kB
react
Panel
200.327 kB
59.336 kB
react
Persona
114.591 kB
36.435 kB
react
PersonaCoin
114.591 kB
36.435 kB
react
PersonaPresence
58.076 kB
19.372 kB
react
Pickers
297.91 kB
82.996 kB
react
Pivot
187.734 kB
56.5 kB
react
Popup
12.312 kB
4.197 kB
react
Positioning
22.764 kB
7.683 kB
react
PositioningContainer
73.445 kB
23.685 kB
react
ProgressIndicator
39.477 kB
13.528 kB
react
Rating
82.086 kB
26.09 kB
react
Fluent UI React (entire library)
1.019 MB
283.183 kB
react
ResizeGroup
13.35 kB
4.379 kB
react
ResponsiveMode
8.13 kB
2.966 kB
react
ScrollablePane
55.541 kB
17.718 kB
react
SearchBox
187.63 kB
55.936 kB
react
SelectableOption
724 B
413 B
react
SelectedItemsList
231.35 kB
67.176 kB
react
Selection
42.418 kB
12.26 kB
react
Separator
35.365 kB
12.132 kB
react
Shimmer
49.249 kB
16.258 kB
react
ShimmeredDetailsList
240.71 kB
68.549 kB
react
Slider
57.627 kB
19.198 kB
react
SpinButton
191.297 kB
57.006 kB
react
Spinner
41.759 kB
14.468 kB
react
Stack
42.039 kB
14.389 kB
react
Sticky
32.577 kB
10.488 kB
react
Styling
46.033 kB
15.135 kB
react
SwatchColorPicker
189.637 kB
57.417 kB
react
TeachingBubble
204.648 kB
60.317 kB
react
Text
36.886 kB
12.806 kB
react
TextField
80.798 kB
25.308 kB
react
Theme
43.486 kB
14.168 kB
react
ThemeGenerator
12.384 kB
4.116 kB
react
TimePicker
240.515 kB
69.311 kB
react
Toggle
46.201 kB
15.957 kB
react
Tooltip
87.073 kB
28.151 kB
react
Utilities
82.938 kB
25.15 kB
react
Viewport
23.872 kB
7.642 kB
react
WeeklyDayPicker
101.348 kB
31.644 kB
react
WindowProvider
1.059 kB
541 B
react-button
Button
33.962 kB
9.022 kB
react-button
CompoundButton
40.843 kB
10.379 kB
react-button
MenuButton
38.866 kB
10.414 kB
react-button
SplitButton
47.663 kB
12.057 kB
react-button
ToggleButton
53.634 kB
11.155 kB
react-card
Card - All
105.222 kB
29.475 kB
react-card
Card
97.84 kB
27.583 kB
react-card
CardFooter
12.774 kB
5.117 kB
react-card
CardHeader
15.303 kB
5.976 kB
react-card
CardPreview
12.854 kB
5.252 kB
react-charting
AreaChart
302.827 kB
94.751 kB
react-charting
ChartHoverCard
37.196 kB
12.7 kB
react-charting
DeclarativeChart
677.039 kB
191.279 kB
react-charting
DonutChart
203.503 kB
63.649 kB
react-charting
GanttChart
282.797 kB
88.761 kB
react-charting
GaugeChart
197.055 kB
61.221 kB
react-charting
GroupedVerticalBarChart
294.547 kB
91.782 kB
react-charting
HeatMapChart
285.643 kB
89.439 kB
react-charting
HorizontalBarChart
127.266 kB
39.944 kB
react-charting
HorizontalBarChartWithAxis
293.937 kB
91.167 kB
react-charting
Legends
151.485 kB
46.4 kB
react-charting
LineChart
332.438 kB
101.79 kB
react-charting
MultiStackedBarChart
181.737 kB
55.262 kB
react-charting
PieChart
134.305 kB
42.299 kB
react-charting
PolarChart
235.153 kB
74.294 kB
react-charting
SankeyChart
158.002 kB
49.166 kB
react-charting
ScatterChart
289.004 kB
91.071 kB
react-charting
Sparkline
87.616 kB
29.671 kB
react-charting
StackedBarChart
175.418 kB
52.858 kB
react-charting
TreeChart
84.809 kB
26.636 kB
react-charting
VerticalBarChart
303.589 kB
93.173 kB
react-charting
VerticalStackedBarChart
300.577 kB
92.782 kB
react-charts
AreaChart
412.454 kB
126.449 kB
react-charts
DeclarativeChart
763.178 kB
220.492 kB
react-charts
DonutChart
322.883 kB
97.008 kB
react-charts
FunnelChart
314.436 kB
94.065 kB
react-charts
GanttChart
395.573 kB
119.965 kB
react-charts
GaugeChart
322.314 kB
96.46 kB
react-charts
GroupedVerticalBarChart
403.443 kB
122.537 kB
react-charts
HeatMapChart
397.644 kB
121.826 kB
react-charts
HorizontalBarChart
302.61 kB
89.151 kB
react-charts
HorizontalBarChartWithAxis
63 B
83 B
react-charts
Legends
242.551 kB
71.624 kB
react-charts
LineChart
423.795 kB
128.511 kB
react-charts
PolarChart
351.496 kB
107.404 kB
react-charts
SankeyChart
220.386 kB
67.867 kB
react-charts
ScatterChart
403.17 kB
122.639 kB
react-charts
Sparkline
91.393 kB
28.708 kB
react-charts
VerticalBarChart
439.914 kB
128.239 kB
react-charts
VerticalStackedBarChart
409.439 kB
124.042 kB
react-checkbox
Checkbox
33.7 kB
11.421 kB
react-combobox
Combobox (including child components)
105.599 kB
34.274 kB
react-combobox
Dropdown (including child components)
106.23 kB
34.229 kB
react-components
react-components: Button, FluentProvider & webLightTheme
70.397 kB
19.96 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
236.743 kB
68.75 kB
react-components
react-components: FluentProvider & webLightTheme
43.612 kB
14.022 kB
react-components
react-components: entire library
1.299 MB
324.701 kB
react-datepicker-compat
DatePicker Compat
225.158 kB
63.633 kB
react-dialog
Dialog (including children components)
102.117 kB
30.367 kB
react-field
Field
22.393 kB
8.383 kB
react-input
Input
26.28 kB
8.702 kB
react-list
List
87.11 kB
25.762 kB
react-list
ListItem
111.018 kB
32.682 kB
react-message-bar
MessageBar (all components)
23.294 kB
8.63 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-progress
ProgressBar
20.167 kB
7.855 kB
react-radio
Radio
31.087 kB
9.656 kB
react-radio
RadioGroup
14.035 kB
5.7 kB
react-select
Select
26.165 kB
9.472 kB
react-slider
Slider
36.356 kB
12.08 kB
react-spinbutton
SpinButton
33.804 kB
11.125 kB
react-swatch-picker
@fluentui/react-swatch-picker - package
104.305 kB
29.944 kB
react-switch
Switch
36.155 kB
11.016 kB
react-table
DataGrid
159.783 kB
45.012 kB
react-table
Table (Primitives only)
40.997 kB
13.172 kB
react-table
Table as DataGrid
131.005 kB
36.012 kB
react-table
Table (Selection only)
69.391 kB
19.404 kB
react-table
Table (Sort only)
68.034 kB
19.022 kB
react-tag-picker
@fluentui/react-tag-picker - package
186.766 kB
55.907 kB
react-teaching-popover
TeachingPopover
112.414 kB
34.219 kB
react-textarea
Textarea
24.668 kB
8.969 kB
react-timepicker-compat
TimePicker
108.565 kB
35.848 kB
react-tree
FlatTree
148.099 kB
42.211 kB
react-tree
PersonaFlatTree
149.927 kB
42.585 kB
react-tree
PersonaTree
145.987 kB
41.411 kB
react-tree
Tree
144.165 kB
41.037 kB
🤖 This report was generated against fc37669010c08b57352656569c789974ff61b990

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

@@ -331,6 +331,8 @@ packages/react-components/component-selector-preview/library @microsoft/teams-pr
packages/react-components/component-selector-preview/stories @microsoft/teams-prg
Copy link
Copy Markdown

@github-actions github-actions bot Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Avatar Converged 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Avatar Converged.badgeMask - RTL.normal.chromium.png 6 Changed
vr-tests-react-components/CalendarCompat 4 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/CalendarCompat.multiDayView.default.chromium_1.png 672 Changed
vr-tests-react-components/CalendarCompat.multiDayView - Dark Mode.default.chromium.png 2215 Changed
vr-tests-react-components/CalendarCompat.multiDayView.default.chromium.png 679 Changed
vr-tests-react-components/CalendarCompat.multiDayView - High Contrast.default.chromium.png 2294 Changed
vr-tests-react-components/Charts-DonutChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Charts-DonutChart.Dynamic - Dark Mode.default.chromium.png 7530 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.chromium.png 731 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 613 Changed
vr-tests-react-components/ProgressBar converged 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png 38 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png 60 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png 36 Changed
vr-tests-react-components/TagPicker 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled.disabled input hover.chromium.png 677 Changed
vr-tests/Callout 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/Callout.No callout width specified.default.chromium.png 2143 Changed
vr-tests/Keytip 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/Keytip.Disabled.default.chromium.png 26 Changed
vr-tests/Keytip.Root.default.chromium.png 55 Changed
vr-tests/react-charting-LineChart 4 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/react-charting-LineChart.Events.default.chromium.png 1 Changed
vr-tests/react-charting-LineChart.Multiple - RTL.default.chromium.png 200 Changed
vr-tests/react-charting-LineChart.Multiple - Dark Mode.default.chromium.png 181 Changed
vr-tests/react-charting-LineChart.Multiple.default.chromium.png 192 Changed
vr-tests/react-charting-MultiStackBarChart 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/react-charting-MultiStackBarChart.Basic_Absolute - Dark Mode.default.chromium.png 363 Changed
vr-tests/react-charting-MultiStackBarChart.Basic_PartToWhole.default.chromium.png 359 Changed
vr-tests/react-charting-VerticalBarChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/react-charting-VerticalBarChart.Basic - Secondary Y Axis.default.chromium.png 3 Changed

There were 4 duplicate changes discarded. Check the build logs for more information.

@dmytrokirpa dmytrokirpa force-pushed the feat/export-base-hooks-from-suite branch 5 times, most recently from 2d8b182 to edb7fd5 Compare April 1, 2026 14:14
@dmytrokirpa dmytrokirpa force-pushed the feat/export-base-hooks-from-suite branch from dc4296c to 8ced617 Compare April 1, 2026 15:34
@dmytrokirpa dmytrokirpa requested a review from Hotell April 1, 2026 15:51
// TODO: Remove this workaround once the stories are fixed or we have a better way to
// decide which stories to include/exclude in docs mode.
'../../../packages/react-components/react-nav/stories/src/Nav/index.stories.@(ts|tsx)',
'../../../packages/react-components/react-base-components/stories/src/*/index.stories.@(ts|tsx)',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this one, if we want to have both Base and Fluent components on the same site

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.

disscused offline -> probably separate SB with composition in v9 docsite

@dmytrokirpa dmytrokirpa marked this pull request as ready for review April 1, 2026 15:57
@Hotell
Copy link
Copy Markdown
Contributor

Hotell commented Apr 2, 2026

we are having additional offline discussion regarding the package naming @fluentui/react-base-components

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