Loading Button
The LoadingButton functionality has graduated from@mui/lab and is now part of the core @mui/material package.
Migration Notice
As of Material UI v9, LoadingButton is available directly in@mui/material/Button. The @mui/lab/LoadingButton export is deprecated and serves only as a wrapper that redirects to the core Button component.
Old Import (Deprecated)
New Import (Recommended)
Basic Usage
The Button component now includes theloading prop:
Loading with Start Icon
Loading with End Icon
Custom Loading Indicator
API Reference
The LoadingButton functionality is now part of the Button API.Additional Button Props for Loading State
| Prop | Type | Default | Description |
|---|---|---|---|
loading | boolean | false | If true, the button will show a loading indicator |
loadingIndicator | node | <CircularProgress /> | Element to display when loading |
loadingPosition | 'start' | 'end' | 'center' | 'center' | Position of the loading indicator |
Migration Steps
To migrate from Lab’s LoadingButton to Material UI’s Button:-
Update imports:
-
Update component usage:
- The API is identical - all props work the same way
-
Remove
@mui/labfrom dependencies if not using other Lab components:
Benefits of Graduation
- Stable API: No more breaking changes
- Better Performance: Optimized as part of core package
- Smaller Bundle: No need for separate Lab package
- Better Support: Full documentation in core Material UI docs
- Long-term Maintenance: Guaranteed support as core component
Full Button Documentation
For complete documentation on the Button component including loading states, visit:Implementation Details
The Lab’s LoadingButton component (at/home/daytona/workspace/source/packages/mui-lab/src/LoadingButton/LoadingButton.js:25) now simply wraps and forwards all props to @mui/material/Button, showing a deprecation warning on first use.