Skip to content

Conversation

@robertpenner
Copy link
Collaborator

@robertpenner robertpenner commented Jan 15, 2026

Summary

This branch migrates slide animations in Popover and Menu components from CSS-based declarative animations to an imperative approach using the Web Animations API (WAAPI).

Key Changes

New Animation Infrastructure

  • Introduces useSlideAnimation hook in @fluentui/react-positioning for imperative WAAPI-based slide animations
  • Exports useAnimateAtoms, useIsReducedMotion, and AnimationHandle type from @fluentui/react-motion for public use

Component Migrations

  • PopoverSurface: Migrated from createSlideStyles CSS approach to useSlideAnimation
  • MenuPopover: Migrated from createSlideStyles CSS approach to useSlideAnimation

Benefits

  • Improved performance by eliminating unnecessary React re-renders
  • 🎛️ More flexible animation control via WAAPI
  • 📦 Reduced bundle size for react-components (~2KB smaller)

Cleanup

  • Removed obsolete createSlideStyles CSS code
  • Added RFC documentation explaining the migration rationale
  • Includes unit tests for the new getSlideOffsets utility

Let me know if you'd like a walkthrough of how the new useSlideAnimation hook works or how to use the newly exported animation APIs!

@robertpenner robertpenner self-assigned this Jan 15, 2026
@robertpenner robertpenner changed the title refactor(Popover, Menu): migrate popover slide from CSS to Slide.In motion component refactor(Popover, Menu): migrate slide animation from CSS to Slide.In motion component Jan 15, 2026
@github-actions
Copy link

github-actions bot commented Jan 15, 2026

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-charts
AreaChart
407.1 kB
124.699 kB
407.701 kB
124.909 kB
601 B
210 B
react-charts
DeclarativeChart
754.686 kB
217.583 kB
755.287 kB
218.422 kB
601 B
839 B
react-charts
DonutChart
317.541 kB
94.674 kB
318.142 kB
95.461 kB
601 B
787 B
react-charts
FunnelChart
309.091 kB
91.565 kB
309.692 kB
92.372 kB
601 B
807 B
react-charts
GanttChart
390.209 kB
118.257 kB
390.809 kB
118.326 kB
600 B
69 B
react-charts
GaugeChart
316.976 kB
94.04 kB
317.577 kB
94.838 kB
601 B
798 B
react-charts
GroupedVerticalBarChart
398.087 kB
120.871 kB
398.688 kB
120.951 kB
601 B
80 B
react-charts
HeatMapChart
392.29 kB
120.005 kB
392.891 kB
120.172 kB
601 B
167 B
react-charts
HorizontalBarChart
297.268 kB
86.238 kB
297.869 kB
87.475 kB
601 B
1.237 kB
react-charts
Legends
236.179 kB
69.581 kB
238.399 kB
70.312 kB
2.22 kB
731 B
react-charts
LineChart
417.662 kB
126.602 kB
418.263 kB
126.702 kB
601 B
100 B
react-charts
PolarChart
346.152 kB
105.674 kB
346.753 kB
105.858 kB
601 B
184 B
react-charts
SankeyChart
214.767 kB
65.946 kB
216.987 kB
66.665 kB
2.22 kB
719 B
react-charts
ScatterChart
397.489 kB
120.755 kB
398.09 kB
120.81 kB
601 B
55 B
react-charts
VerticalBarChart
433.099 kB
126.202 kB
433.7 kB
126.435 kB
601 B
233 B
react-charts
VerticalStackedBarChart
404.001 kB
121.693 kB
404.602 kB
122.347 kB
601 B
654 B
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
237.728 kB
68.689 kB
235.667 kB
68.576 kB
-2.061 kB
-113 B
react-components
react-components: entire library
1.287 MB
322.479 kB
1.285 MB
321.728 kB
-2.314 kB
-751 B
react-menu
Menu (including children components)
164.6 kB
49.855 kB
166.82 kB
50.691 kB
2.22 kB
836 B
react-menu
Menu (including selectable components)
167.778 kB
50.457 kB
169.998 kB
51.249 kB
2.22 kB
792 B
react-popover
Popover
128.086 kB
39.594 kB
130.307 kB
40.315 kB
2.221 kB
721 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-accordion
Accordion (including children components)
107.473 kB
32.898 kB
react-avatar
Avatar
48.532 kB
15.449 kB
react-avatar
AvatarGroup
18.323 kB
7.316 kB
react-avatar
AvatarGroupItem
61.784 kB
19.45 kB
react-breadcrumb
@fluentui/react-breadcrumb - package
115.745 kB
31.735 kB
react-charts
HorizontalBarChartWithAxis
63 B
83 B
react-charts
Sparkline
91.393 kB
28.708 kB
react-checkbox
Checkbox
34.395 kB
11.722 kB
react-combobox
Combobox (including child components)
106.057 kB
34.479 kB
react-combobox
Dropdown (including child components)
106.681 kB
34.406 kB
react-components
react-components: Button, FluentProvider & webLightTheme
70.309 kB
20.074 kB
react-components
react-components: FluentProvider & webLightTheme
43.608 kB
14.165 kB
react-datepicker-compat
DatePicker Compat
225.887 kB
63.911 kB
react-dialog
Dialog (including children components)
102.951 kB
30.715 kB
react-field
Field
22.798 kB
8.574 kB
react-input
Input
27.119 kB
9.011 kB
react-list
List
87.983 kB
26.098 kB
react-list
ListItem
111.568 kB
32.962 kB
react-message-bar
MessageBar (all components)
24.137 kB
8.901 kB
react-motion
@fluentui/react-motion - createMotionComponent()
4.156 kB
1.818 kB
react-motion
@fluentui/react-motion - createPresenceComponent()
5.908 kB
2.442 kB
react-motion
@fluentui/react-motion - PresenceGroup
1.727 kB
823 B
react-overflow
hooks only
11.977 kB
4.574 kB
react-persona
Persona
55.423 kB
17.327 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-positioning
usePositioning
28.865 kB
10.146 kB
react-positioning
useSafeZoneArea
12.445 kB
5 kB
react-progress
ProgressBar
16.573 kB
6.527 kB
react-radio
Radio
31.778 kB
9.929 kB
react-radio
RadioGroup
14.867 kB
6.008 kB
react-select
Select
26.958 kB
9.754 kB
react-slider
Slider
37.195 kB
12.382 kB
react-spinbutton
SpinButton
34.442 kB
11.368 kB
react-swatch-picker
@fluentui/react-swatch-picker - package
105.143 kB
30.259 kB
react-switch
Switch
35.375 kB
11.144 kB
react-table
DataGrid
160.182 kB
45.256 kB
react-table
Table (Primitives only)
41.87 kB
13.485 kB
react-table
Table as DataGrid
131.397 kB
36.257 kB
react-table
Table (Selection only)
69.785 kB
19.62 kB
react-table
Table (Sort only)
68.428 kB
19.236 kB
react-tag-picker
@fluentui/react-tag-picker - package
187.407 kB
56.165 kB
react-tags
InteractionTag
14.539 kB
5.779 kB
react-tags
Tag
30.394 kB
9.712 kB
react-tags
TagGroup
83.084 kB
24.483 kB
react-teaching-popover
TeachingPopover
102.017 kB
30.539 kB
react-textarea
Textarea
25.501 kB
9.27 kB
react-timepicker-compat
TimePicker
109.023 kB
36.011 kB
react-toast
Toast (including Toaster)
103.433 kB
30.931 kB
react-tooltip
Tooltip
57.962 kB
20.022 kB
react-tree
FlatTree
148.508 kB
42.451 kB
react-tree
PersonaFlatTree
150.334 kB
42.836 kB
react-tree
PersonaTree
146.394 kB
41.664 kB
react-tree
Tree
144.574 kB
41.291 kB
🤖 This report was generated against db44e6456a700c382147e17df018c9615af0a40b

@github-actions
Copy link

Pull request demo site: URL

@@ -0,0 +1,7 @@
{
Copy link

@github-actions github-actions bot Jan 15, 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 2 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/Avatar Converged.badgeMask.normal.chromium.png 4 Changed
vr-tests-react-components/Charts-DonutChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Charts-DonutChart.Dynamic.default.chromium.png 5581 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png 607 Changed
vr-tests-react-components/Popover Converged 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Popover Converged.when rendering inline, it should not render behind relatively positioned elements.PopoverSurface focused.chromium.png 93 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.chromium.png 615 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 14 Changed

@robertpenner robertpenner changed the title refactor(Popover, Menu): migrate slide animation from CSS to Slide.In motion component refactor(Popover, Menu): migrate slide animation from CSS to motion component Jan 15, 2026
@robertpenner robertpenner force-pushed the refactor/popover-motion-component branch from be02d1f to 1af3aaa Compare January 21, 2026 01:12
@robertpenner robertpenner added the Package: motion react-motion related changes label Jan 21, 2026
@robertpenner robertpenner force-pushed the refactor/popover-motion-component branch from a0607e8 to 49c8363 Compare January 21, 2026 09:50
@github-actions github-actions bot added the Type: RFC Request for Feedback label Jan 21, 2026
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.

1 participant