Install Base UI, a library of headless ("unstyled") React UI components and low-level hooks.
-
-Run one of the following commands to add Base UI to your project:
-
-## npm
-
-```sh
-npm install @mui/base
-```
-
-## yarn
-
-```sh
-yarn add @mui/base
-```
-
-## Peer dependencies
-
-
-
-[`react`](https://www.npmjs.com/package/react) >= 17.0.0 and [`react-dom`](https://www.npmjs.com/package/react-dom) >= 17.0.0 are peer dependencies.
diff --git a/docs/data/base/getting-started/quickstart/BaseButton.js b/docs/data/base/getting-started/quickstart/BaseButton.js
new file mode 100644
index 00000000000000..9a8e94901b2052
--- /dev/null
+++ b/docs/data/base/getting-started/quickstart/BaseButton.js
@@ -0,0 +1,17 @@
+import * as React from 'react';
+import Button from '@mui/base/Button';
+import useButton from '@mui/base/useButton';
+import Stack from '@mui/material/Stack';
+
+export default function App() {
+ const { getRootProps } = useButton({});
+ return (
+ Get started with Base UI, a library of headless ("unstyled") React UI components and low-level hooks.
+
+## Installation
+
+`@mui/base` is completely standalone ā run one of the following commands to add Base UI to your React project:
+
+### With npm
+
+```sh
+npm install @mui/base
+```
+
+### With yarn
+
+```sh
+yarn add @mui/base
+```
+
+### With pnpm
+
+```sh
+pnpm add @mui/base
+```
+
+### Peer dependencies
+
+
+
+[`react`](https://www.npmjs.com/package/react) >= 17.0.0 and [`react-dom`](https://www.npmjs.com/package/react-dom) >= 17.0.0 are peer dependencies.
+
+## Implementing a Button
+
+This is a quick tutorial that goes through the basics of using and styling Base UI components by replicating a button from GitHub's UI, using their [Primer design system](https://primer.style) as a reference.
+
+{{"demo": "Tutorial.js", "defaultCodeOpen": false, "hideToolbar": true}}
+
+### Components and hooks
+
+Base UI provides a `Learn the basics of working with Base UI components.
-## Quickstart
-
-The following code snippet demonstrates a simple app that uses the Base UI [Button](/base/react-button/) component:
-
-```jsx
-import * as React from 'react';
-import Button from '@mui/base/Button';
-
-export default function MyApp() {
- return (
- `:
-
-{{"demo": "Usage.js", "hideToolbar": true, "bg": true}}
-
## Responsive meta tag
Base UI is a _mobile-first_ component libraryāwe write code for mobile devices first, and then scale up the components as necessary using CSS media queries.
diff --git a/docs/data/base/pages.ts b/docs/data/base/pages.ts
index 71de915d2c0415..c5b3414c112c9d 100644
--- a/docs/data/base/pages.ts
+++ b/docs/data/base/pages.ts
@@ -7,7 +7,7 @@ const pages = [
icon: standardNavIcons.DescriptionIcon,
children: [
{ pathname: '/base/getting-started/overview', title: 'Overview' },
- { pathname: '/base/getting-started/installation', title: 'Installation' },
+ { pathname: '/base/getting-started/quickstart', title: 'Quickstart' },
{ pathname: '/base/getting-started/usage', title: 'Usage' },
{ pathname: '/base/getting-started/customization', title: 'Customization' },
],
diff --git a/docs/data/joy/components/aspect-ratio/IconWrapper.js b/docs/data/joy/components/aspect-ratio/IconWrapper.js
new file mode 100644
index 00000000000000..e18c53609874d2
--- /dev/null
+++ b/docs/data/joy/components/aspect-ratio/IconWrapper.js
@@ -0,0 +1,37 @@
+import * as React from 'react';
+import AspectRatio from '@mui/joy/AspectRatio';
+import Stack from '@mui/joy/Stack';
+import Favorite from '@mui/icons-material/Favorite';
+
+export default function IconWrapper() {
+ return (
+
+
+ {/* an extra div is required to make the icon center */}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/docs/data/joy/components/aspect-ratio/IconWrapper.tsx b/docs/data/joy/components/aspect-ratio/IconWrapper.tsx
new file mode 100644
index 00000000000000..e18c53609874d2
--- /dev/null
+++ b/docs/data/joy/components/aspect-ratio/IconWrapper.tsx
@@ -0,0 +1,37 @@
+import * as React from 'react';
+import AspectRatio from '@mui/joy/AspectRatio';
+import Stack from '@mui/joy/Stack';
+import Favorite from '@mui/icons-material/Favorite';
+
+export default function IconWrapper() {
+ return (
+
+
+ {/* an extra div is required to make the icon center */}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/docs/data/joy/components/aspect-ratio/aspect-ratio.md b/docs/data/joy/components/aspect-ratio/aspect-ratio.md
index 1d7680749b5867..216566ab63e787 100644
--- a/docs/data/joy/components/aspect-ratio/aspect-ratio.md
+++ b/docs/data/joy/components/aspect-ratio/aspect-ratio.md
@@ -14,7 +14,7 @@ Aspect Ratio is a wrapper component for quickly resizing content to conform to y
Media content like images can be stretched, resized, and cropped based on the CSS `object-fit` property.
:::info
-A [native CSS `aspect-ratio` property](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio) does exist, but MUI does not plan to implement it until browser compatibility increases to at least 94%.
+A [native CSS `aspect-ratio` property](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio) does exist, but MUI does not plan to implement it in Joy UI until browser compatibility increases to at least 94%.
As of Q4 2022, compatibility is at 90%.
Source: [Can I useā¦](https://caniuse.com/?search=aspect-ratio)
:::
@@ -76,13 +76,13 @@ This is useful when the Aspect Ratio component wraps dynamic-width content, as s
{{"demo": "MinMaxRatio.js"}}
-## Usage inside a flex row
+## Using inside a flex row
When the Aspect Ratio component is a child of a flexbox `row` container, use `flex-basis` to set the ideal width of the content:
{{"demo": "FlexRowRatio.js"}}
-## Usage with Next.js Image
+## Using with Next.js Image
The Aspect Ratio component can be used with a [Next.js Image](https://nextjs.org/docs/basic-features/image-optimization) component as a child.
The Image should always include the `layout="fill"` propertyāotherwise it requires `height` and `width` values, which would defeat the purpose of the Aspect Ratio component.
@@ -102,6 +102,14 @@ function App() {
}
```
+## Using with an icon
+
+The Aspect Ratio component can be a handy tool for creating a square container for an icon.
+
+The example below show
+
+{{"demo": "IconWrapper.js"}}
+
## Common examples
### Mobile carousel
diff --git a/docs/data/joy/components/css-baseline/css-baseline.md b/docs/data/joy/components/css-baseline/css-baseline.md
index 9d6f97904d37d5..947d37b24fb65b 100644
--- a/docs/data/joy/components/css-baseline/css-baseline.md
+++ b/docs/data/joy/components/css-baseline/css-baseline.md
@@ -33,7 +33,7 @@ export default function MyApp() {
## Scoping on children
-However, you might be progressively migrating a website to MUI, using a global reset might not be an option.
+However, you might be progressively migrating a website to Joy UI, using a global reset might not be an option.
It's possible to apply the baseline only to the children by using the `ScopedCssBaseline` component.
```jsx
diff --git a/docs/data/joy/components/grid/SpacingGrid.js b/docs/data/joy/components/grid/SpacingGrid.js
index a1270710829d93..01ebc1d717b2aa 100644
--- a/docs/data/joy/components/grid/SpacingGrid.js
+++ b/docs/data/joy/components/grid/SpacingGrid.js
@@ -40,7 +40,7 @@ export default function SpacingGrid() {
- spacing
+ spacing
- spacing
+ spacing
{
+ setAge(newValue);
+ };
+
+ return (
+
+ {
+ skipRef.current = true;
+ }}
+ onClick={() => {
+ skipRef.current = false;
+ setOpen((bool) => !bool);
+ }}
+ >
+ Open the select
+
+
+ {
+ if (!skipRef.current) {
+ setOpen(isOpen);
+ }
+ }}
+ value={age}
+ onChange={handleChange}
+ >
+
+ None
+
+ Ten
+ Twenty
+ Thirty
+
+
+
+ );
+}
diff --git a/docs/data/joy/components/select/ControlledOpenSelect.tsx b/docs/data/joy/components/select/ControlledOpenSelect.tsx
new file mode 100644
index 00000000000000..10cb612c287f43
--- /dev/null
+++ b/docs/data/joy/components/select/ControlledOpenSelect.tsx
@@ -0,0 +1,54 @@
+import * as React from 'react';
+import Stack from '@mui/joy/Stack';
+import Select from '@mui/joy/Select';
+import Option from '@mui/joy/Option';
+import Button from '@mui/joy/Button';
+
+export default function ControlledOpenSelect() {
+ const [age, setAge] = React.useState('');
+ const [open, setOpen] = React.useState(false);
+ const skipRef = React.useRef(false);
+
+ const handleChange = (
+ event: React.SyntheticEvent | null,
+ newValue: string | null,
+ ) => {
+ setAge(newValue!);
+ };
+
+ return (
+
+ {
+ skipRef.current = true;
+ }}
+ onClick={() => {
+ skipRef.current = false;
+ setOpen((bool) => !bool);
+ }}
+ >
+ Open the select
+
+
+ {
+ if (!skipRef.current) {
+ setOpen(isOpen);
+ }
+ }}
+ value={age}
+ onChange={handleChange}
+ >
+
+ None
+
+ Ten
+ Twenty
+ Thirty
+
+
+
+ );
+}
diff --git a/docs/data/joy/components/select/SelectBasic.js b/docs/data/joy/components/select/SelectBasic.js
index 3fa4686a460da1..a40c919b544bb5 100644
--- a/docs/data/joy/components/select/SelectBasic.js
+++ b/docs/data/joy/components/select/SelectBasic.js
@@ -3,8 +3,11 @@ import Select from '@mui/joy/Select';
import Option from '@mui/joy/Option';
export default function SelectBasic() {
+ const handleChange = (event, newValue) => {
+ alert(`You chose "${newValue}"`);
+ };
return (
-
+
Dog
Cat
Fish
diff --git a/docs/data/joy/components/select/SelectBasic.tsx b/docs/data/joy/components/select/SelectBasic.tsx
index 3fa4686a460da1..32403626c32cfa 100644
--- a/docs/data/joy/components/select/SelectBasic.tsx
+++ b/docs/data/joy/components/select/SelectBasic.tsx
@@ -3,8 +3,14 @@ import Select from '@mui/joy/Select';
import Option from '@mui/joy/Option';
export default function SelectBasic() {
+ const handleChange = (
+ event: React.SyntheticEvent | null,
+ newValue: string | null,
+ ) => {
+ alert(`You chose "${newValue}"`);
+ };
return (
-
+
Dog
Cat
Fish
diff --git a/docs/data/joy/components/select/SelectBasic.tsx.preview b/docs/data/joy/components/select/SelectBasic.tsx.preview
index 95b6c2a0879e38..3f25d283e28033 100644
--- a/docs/data/joy/components/select/SelectBasic.tsx.preview
+++ b/docs/data/joy/components/select/SelectBasic.tsx.preview
@@ -1,4 +1,4 @@
-
+
Dog
Cat
Fish
diff --git a/docs/data/joy/components/select/select.md b/docs/data/joy/components/select/select.md
index 1eb5ee06828cfa..6f9fa42e9f5a52 100644
--- a/docs/data/joy/components/select/select.md
+++ b/docs/data/joy/components/select/select.md
@@ -132,6 +132,12 @@ To control the placement of the listbox, use `placement`:
:::
+#### Controlling the open state
+
+You can control the open state of the select with the `listboxOpen` prop. Alternatively, it is also possible to set the initial (uncontrolled) open state of the component with the `defaultListboxOpen` prop.
+
+{{"demo": "ControlledOpenSelect.js"}}
+
### `Option` component
The `Option` component is used for the choosable options within the select.
diff --git a/docs/data/joy/components/switch/SwitchUsage.js b/docs/data/joy/components/switch/SwitchUsage.js
index dec33a38f20129..fb2c378c958dbf 100644
--- a/docs/data/joy/components/switch/SwitchUsage.js
+++ b/docs/data/joy/components/switch/SwitchUsage.js
@@ -24,7 +24,7 @@ export default function SwitchUsage() {
options: ['sm', 'md', 'lg'],
defaultValue: 'md',
},
- { propName: 'checked', knob: 'switch', defaultValue: false },
+ { propName: 'checked', knob: 'controlled' },
{ propName: 'disabled', knob: 'switch' },
]}
renderDemo={(props) => }
diff --git a/docs/data/joy/guides/using-icon-libraries/using-icon-libraries.md b/docs/data/joy/guides/using-icon-libraries/using-icon-libraries.md
index 9e63521d6bd56c..8b4ab56eb551bf 100644
--- a/docs/data/joy/guides/using-icon-libraries/using-icon-libraries.md
+++ b/docs/data/joy/guides/using-icon-libraries/using-icon-libraries.md
@@ -187,3 +187,29 @@ Here is a collection of well-known icon libraries that you can use with Joy UI.
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
>
+
+### Iconify
+
+- [Browse icons](https://icon-sets.iconify.design/)
+- [InstallationāReact](https://docs.iconify.design/icon-components/react/)
+- [InstallationāWeb component](https://docs.iconify.design/iconify-icon/)
+- [Figma plugin](https://docs.iconify.design/design/figma/)
+
+
+
+### Lucide
+
+- [Browse icons](https://icon-sets.iconify.design/)
+- [InstallationāReact](https://lucide.dev/docs/lucide-react)
+
+
diff --git a/docs/data/joy/guides/using-joy-ui-and-material-ui/using-joy-ui-and-material-ui.md b/docs/data/joy/guides/using-joy-ui-and-material-ui/using-joy-ui-and-material-ui.md
index b781c0bf41ecb1..8811fb0cc4c0c6 100644
--- a/docs/data/joy/guides/using-joy-ui-and-material-ui/using-joy-ui-and-material-ui.md
+++ b/docs/data/joy/guides/using-joy-ui-and-material-ui/using-joy-ui-and-material-ui.md
@@ -18,6 +18,11 @@ Additionally, keep these in mind when using them together:
- Both of them use [MUI System](/system/getting-started/overview/) as their style engine, which uses React context for theming.
- Theme scoping must be done on one of the libraries.
+## Prerequisite
+
+- Have `@mui/material` and `@mui/joy` installed in your project.
+- The version of both libraries must be [v5.12.0](https://github.com/mui/material-ui/releases/tag/v5.12.0) or higher.
+
## Set up the providers
Render Material UI's `CssVarsProvider` inside Joy UI's provider and use `THEME_ID` to separate the themes from each other.
diff --git a/docs/data/joy/main-features/automatic-adjustment/InputIntegration.js b/docs/data/joy/main-features/automatic-adjustment/InputIntegration.js
index 4ecd493f597f54..c7e9edf7179610 100644
--- a/docs/data/joy/main-features/automatic-adjustment/InputIntegration.js
+++ b/docs/data/joy/main-features/automatic-adjustment/InputIntegration.js
@@ -14,7 +14,7 @@ export default function InputIntegration() {
placeholder="Password"
type="password"
endDecorator={
-
+
}
@@ -24,7 +24,7 @@ export default function InputIntegration() {
placeholder="Password"
type="password"
endDecorator={
-
+
}
diff --git a/docs/data/joy/pages.ts b/docs/data/joy/pages.ts
index 695b91b7293e68..8f27cb6e158738 100644
--- a/docs/data/joy/pages.ts
+++ b/docs/data/joy/pages.ts
@@ -103,7 +103,7 @@ const pages = [
],
},
{
- title: 'Component API',
+ title: 'APIs',
pathname: '/joy-ui/api',
icon: standardNavIcons.CodeIcon,
children: pagesApi,
diff --git a/docs/data/material/components/box/box.md b/docs/data/material/components/box/box.md
index 600909bcd55abb..3f4a7fe06b8d4d 100644
--- a/docs/data/material/components/box/box.md
+++ b/docs/data/material/components/box/box.md
@@ -24,7 +24,7 @@ In addition, the `sx` prop allows you to specify any other CSS rules you may nee
{{"demo": "BoxSx.js", "defaultCodeOpen": true }}
-## Overriding MUI components
+## Overriding Material UI components
The Box component wraps your component.
It creates a new DOM element, a `` that by default can be changed with the `component` prop.
@@ -38,7 +38,7 @@ For instance, you can change the margin this way.
However, sometimes you have to target the underlying DOM element.
As an example, you may want to change the border of the Button.
The Button component defines its own styles. CSS inheritance doesn't help.
-To workaround the problem, you can use the [`sx`](/system/getting-started/the-sx-prop/) prop directly on the child if it is a MUI component.
+To workaround the problem, you can use the [`sx`](/system/getting-started/the-sx-prop/) prop directly on the child if it is a Material UI component.
```diff
-
@@ -47,7 +47,7 @@ To workaround the problem, you can use the [`sx`](/system/getting-started/the-sx
+Save
```
-For non-MUI components, use the `component` prop.
+For non-Material UI components, use the `component` prop.
```diff
-
diff --git a/docs/data/material/components/css-baseline/css-baseline.md b/docs/data/material/components/css-baseline/css-baseline.md
index d0c0033f997444..b4583ada27f05d 100644
--- a/docs/data/material/components/css-baseline/css-baseline.md
+++ b/docs/data/material/components/css-baseline/css-baseline.md
@@ -30,7 +30,7 @@ export default function MyApp() {
## Scoping on children
-However, you might be progressively migrating a website to MUI, using a global reset might not be an option.
+However, you might be progressively migrating a website to Material UI, using a global reset might not be an option.
It's possible to apply the baseline only to the children by using the `ScopedCssBaseline` component.
```jsx
diff --git a/docs/data/material/components/dialogs/dialogs.md b/docs/data/material/components/dialogs/dialogs.md
index 22e3dced75deb6..917b29e0c0e383 100644
--- a/docs/data/material/components/dialogs/dialogs.md
+++ b/docs/data/material/components/dialogs/dialogs.md
@@ -137,12 +137,14 @@ Follow the [Modal limitations section](/material-ui/react-modal/#limitations).
## Complementary projects
-### Material UI Confirm
+For more advanced use cases you might be able to take advantage of:
-![stars](https://img.shields.io/github/stars/jonatanklosko/material-ui-confirm)
+### material-ui-confirm
+
+![stars](https://img.shields.io/github/stars/jonatanklosko/material-ui-confirm?style=social&label=Star)
![npm downloads](https://img.shields.io/npm/dm/material-ui-confirm.svg)
-This package provides dialogs for confirming user actions without writing boilerplate code.
+The package [`material-ui-confirm`](https://github.com/jonatanklosko/material-ui-confirm/) provides dialogs for confirming user actions without writing boilerplate code.
## Accessibility
diff --git a/docs/data/material/components/grid2/grid2.md b/docs/data/material/components/grid2/grid2.md
index e0f50bbf698a8e..aed3d9d46b5763 100644
--- a/docs/data/material/components/grid2/grid2.md
+++ b/docs/data/material/components/grid2/grid2.md
@@ -32,7 +32,7 @@ From now on, the `Grid` v1 and `Grid` v2 refer to the import as:
```js
import Grid from '@mui/material/Grid'; // Grid version 1
-import Grid2 from '@mui/material/Unstable_Grid2'; // Grid version 2
+import Grid from '@mui/material/Unstable_Grid2'; // Grid version 2
```
:::
diff --git a/docs/data/material/components/icons/icons.md b/docs/data/material/components/icons/icons.md
index bb8357c4329d33..7aabade29d51ab 100644
--- a/docs/data/material/components/icons/icons.md
+++ b/docs/data/material/components/icons/icons.md
@@ -8,9 +8,9 @@ materialDesign: https://m2.material.io/design/iconography/system-icons.html
# Icons
-Guidance and suggestions for using icons with MUI.
+Guidance and suggestions for using icons with Material UI.
-MUI provides icons support in three ways:
+Material UI provides icon support in three ways:
1. Standardized [Material Icons](#material-svg-icons) exported as React components (SVG icons).
1. With the [SvgIcon](#svgicon) component, a React wrapper for custom SVG icons.
@@ -36,7 +36,7 @@ Or **yarn**:
yarn add @mui/icons-material
```
-These components use the MUI `SvgIcon` component to render the SVG path for each icon, and so have a peer-dependency on `@mui/material`.
+These components use the Material UI `SvgIcon` component to render the SVG path for each icon, and so have a peer-dependency on `@mui/material`.
If you aren't already using Material UI in your project, you can add it following the [installation guide](/material-ui/getting-started/installation/).
@@ -94,7 +94,7 @@ If you need a custom SVG icon (not available in the [Material Icons](/material-u
This component extends the native `` element:
- It comes with built-in accessibility.
-- SVG elements should be scaled for a 24x24px viewport so that the resulting icon can be used as is, or included as a child for other MUI components that use icons.
+- SVG elements should be scaled for a 24x24px viewport so that the resulting icon can be used as is, or included as a child for other Material UI components that use icons.
This can be customized with the `viewBox` attribute.
To inherit the `viewBox` value from the original image, the `inheritViewBox` prop can be used.
- By default, the component inherits the current color. Optionally, you can apply one of the theme colors using the `color` prop.
diff --git a/docs/data/material/components/menus/menus.md b/docs/data/material/components/menus/menus.md
index 19dd0690113ad9..c7895c32a938a0 100644
--- a/docs/data/material/components/menus/menus.md
+++ b/docs/data/material/components/menus/menus.md
@@ -110,8 +110,11 @@ Here is an example of a context menu. (Right click to open.)
For more advanced use cases you might be able to take advantage of:
-### PopupState helper
+### material-ui-popup-state
-There is a 3rd party package [`material-ui-popup-state`](https://github.com/jcoreio/material-ui-popup-state) that takes care of menu state for you in most cases.
+![stars](https://img.shields.io/github/stars/jcoreio/material-ui-popup-state?style=social&label=Star)
+![npm downloads](https://img.shields.io/npm/dm/material-ui-popup-state.svg)
+
+The package [`material-ui-popup-state`](https://github.com/jcoreio/material-ui-popup-state) that takes care of menu state for you in most cases.
{{"demo": "MenuPopupState.js"}}
diff --git a/docs/data/material/components/pagination/pagination.md b/docs/data/material/components/pagination/pagination.md
index 35cda40569f099..430e9dc520172f 100644
--- a/docs/data/material/components/pagination/pagination.md
+++ b/docs/data/material/components/pagination/pagination.md
@@ -41,7 +41,7 @@ It's possible to customize the control icons.
## Pagination ranges
-You can specify how many digits to display either side of current page with the `siblingRange` prop, and adjacent to the start and end page number with the `boundaryRange` prop.
+You can specify how many digits to display either side of current page with the `siblingCount` prop, and adjacent to the start and end page number with the `boundaryCount` prop.
{{"demo": "PaginationRanges.js"}}
diff --git a/docs/data/material/components/popover/popover.md b/docs/data/material/components/popover/popover.md
index fdd898228a5d67..e3790c005680b9 100644
--- a/docs/data/material/components/popover/popover.md
+++ b/docs/data/material/components/popover/popover.md
@@ -40,9 +40,11 @@ This demo demonstrates how to use the `Popover` component and the mouseover even
For more advanced use cases, you might be able to take advantage of:
-### PopupState helper
+### material-ui-popup-state
-There is a 3rd party package [`material-ui-popup-state`](https://github.com/jcoreio/material-ui-popup-state) that takes care of popover
-state for you in most cases.
+![stars](https://img.shields.io/github/stars/jcoreio/material-ui-popup-state?style=social&label=Star)
+![npm downloads](https://img.shields.io/npm/dm/material-ui-popup-state.svg)
+
+The package [`material-ui-popup-state`](https://github.com/jcoreio/material-ui-popup-state) that takes care of popover state for you in most cases.
{{"demo": "PopoverPopupState.js"}}
diff --git a/docs/data/material/components/popper/popper.md b/docs/data/material/components/popper/popper.md
index 2a66c4a6ec3edf..71d60732f06ad7 100644
--- a/docs/data/material/components/popper/popper.md
+++ b/docs/data/material/components/popper/popper.md
@@ -68,9 +68,11 @@ Highlight part of the text to see the popper:
For more advanced use cases you might be able to take advantage of:
-### PopupState helper
+### material-ui-popup-state
-There is a 3rd party package [`material-ui-popup-state`](https://github.com/jcoreio/material-ui-popup-state) that takes care of popper
-state for you in most cases.
+![stars](https://img.shields.io/github/stars/jcoreio/material-ui-popup-state?style=social&label=Star)
+![npm downloads](https://img.shields.io/npm/dm/material-ui-popup-state.svg)
+
+The package [`material-ui-popup-state`](https://github.com/jcoreio/material-ui-popup-state) that takes care of popper state for you in most cases.
{{"demo": "PopperPopupState.js"}}
diff --git a/docs/data/material/components/snackbars/snackbars.md b/docs/data/material/components/snackbars/snackbars.md
index 233773dad3617b..6953739a60a0c7 100644
--- a/docs/data/material/components/snackbars/snackbars.md
+++ b/docs/data/material/components/snackbars/snackbars.md
@@ -94,7 +94,7 @@ For more advanced use cases you might be able to take advantage of:
### notistack
-![stars](https://img.shields.io/github/stars/iamhosseindhv/notistack.svg?style=social&label=Stars)
+![stars](https://img.shields.io/github/stars/iamhosseindhv/notistack.svg?style=social&label=Star)
![npm downloads](https://img.shields.io/npm/dm/notistack.svg)
This example demonstrates how to use [notistack](https://github.com/iamhosseindhv/notistack).
diff --git a/docs/data/material/components/stack/stack.md b/docs/data/material/components/stack/stack.md
index 8604a8413e28c6..40e4685898c423 100644
--- a/docs/data/material/components/stack/stack.md
+++ b/docs/data/material/components/stack/stack.md
@@ -22,7 +22,7 @@ Stack is ideal for one-dimensional layouts, while Grid is preferable when you ne
## Basics
```jsx
-import Stack from '@mui/joy/Stack';
+import Stack from '@mui/material/Stack';
```
The Stack component acts as a generic container, wrapping around the elements to be arranged.
diff --git a/docs/data/material/components/table/DataTable.js b/docs/data/material/components/table/DataTable.js
index b2e857d238971e..140a43ac724245 100644
--- a/docs/data/material/components/table/DataTable.js
+++ b/docs/data/material/components/table/DataTable.js
@@ -40,7 +40,12 @@ export default function DataTable() {
diff --git a/docs/data/material/components/table/DataTable.tsx b/docs/data/material/components/table/DataTable.tsx
index eefa8d3a2101f0..ded4d20968901b 100644
--- a/docs/data/material/components/table/DataTable.tsx
+++ b/docs/data/material/components/table/DataTable.tsx
@@ -40,7 +40,12 @@ export default function DataTable() {
diff --git a/docs/data/material/components/table/DataTable.tsx.preview b/docs/data/material/components/table/DataTable.tsx.preview
index e28635e54d7954..925b43c630a7c0 100644
--- a/docs/data/material/components/table/DataTable.tsx.preview
+++ b/docs/data/material/components/table/DataTable.tsx.preview
@@ -1,6 +1,11 @@
` element, you should also add the CSS property _pointer-events: none;_ to your element when disabled:
+If you're not wrapping a Material UI component that inherits from `ButtonBase`, for instance, a native `` element, you should also add the CSS property _pointer-events: none;_ to your element when disabled:
:::
```jsx
diff --git a/docs/data/material/components/transitions/transitions.md b/docs/data/material/components/transitions/transitions.md
index 43b76a31d5db32..8c1b84bd5ccba7 100644
--- a/docs/data/material/components/transitions/transitions.md
+++ b/docs/data/material/components/transitions/transitions.md
@@ -9,7 +9,7 @@ githubLabel: 'component: transitions'
Transitions help to make a UI expressive and easy to use.
-MUI provides transitions that can be used to introduce some basic [motion](https://m2.material.io/design/motion/) to your applications.
+Material UI provides transitions that can be used to introduce some basic [motion](https://m2.material.io/design/motion/) to your applications.
{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}
@@ -66,7 +66,7 @@ This example also demonstrates how to delay the enter transition.
## Child requirement
-- **Forward the style**: To better support server rendering, MUI provides a `style` prop to the children of some transition components (Fade, Grow, Zoom, Slide).
+- **Forward the style**: To better support server rendering, Material UI provides a `style` prop to the children of some transition components (Fade, Grow, Zoom, Slide).
The `style` prop must be applied to the DOM for the animation to work as expected.
- **Forward the ref**: The transition components require the first child element to forward its ref to the DOM node. For more details about ref, check out [Caveat with refs](/material-ui/guides/composition/#caveat-with-refs)
- **Single element**: The transition components require only one child element (`React.Fragment` is not allowed).
@@ -101,7 +101,7 @@ As components are added or removed, the `in` prop is toggled automatically by `T
## TransitionComponent prop
-Some MUI components use these transitions internally. These accept a `TransitionComponent` prop to customize the default transition.
+Some Material UI components use these transitions internally. These accept a `TransitionComponent` prop to customize the default transition.
You can use any of the above components or your own.
It should respect the following conditions:
diff --git a/docs/data/material/components/typography/typography.md b/docs/data/material/components/typography/typography.md
index 5fd028b6a14aa1..a3a90672c11ef2 100644
--- a/docs/data/material/components/typography/typography.md
+++ b/docs/data/material/components/typography/typography.md
@@ -17,7 +17,7 @@ A [typographic scale](https://m2.material.io/design/typography/#type-scale) has
## General
-The _Roboto_ font will **not** be automatically loaded by MUI.
+The _Roboto_ font will **not** be automatically loaded by Material UI.
You are responsible for loading any fonts used in your application.
Roboto Font has a few easy ways to get started. For more advanced configuration, check out
[the theme customization section](/material-ui/customization/typography/).
@@ -57,7 +57,7 @@ import '@fontsource/roboto/700.css';
For more info check out [Fontsource](https://github.com/fontsource/fontsource).
Fontsource can be configured to load specific subsets, weights and styles.
-MUI default typography configuration only relies on 300, 400, 500, and 700 font weights.
+Material UI default typography configuration only relies on 300, 400, 500, and 700 font weights.
## Component
diff --git a/docs/data/material/components/use-media-query/use-media-query.md b/docs/data/material/components/use-media-query/use-media-query.md
index d90bdafb2557e4..b624e1edced218 100644
--- a/docs/data/material/components/use-media-query/use-media-query.md
+++ b/docs/data/material/components/use-media-query/use-media-query.md
@@ -26,9 +26,9 @@ The media query string can be any valid CSS media query, e.g. [`'(prefers-color-
ā ļø You can't use `'print'` per browsers limitation, e.g. [Firefox](https://bugzilla.mozilla.org/show_bug.cgi?id=774398).
-## Using MUI's breakpoint helpers
+## Using Material UI's breakpoint helpers
-You can use MUI's [breakpoint helpers](/material-ui/customization/breakpoints/) as follows:
+You can use Material UI's [breakpoint helpers](/material-ui/customization/breakpoints/) as follows:
```jsx
import { useTheme } from '@mui/material/styles';
diff --git a/docs/data/material/customization/breakpoints/breakpoints.md b/docs/data/material/customization/breakpoints/breakpoints.md
index 1f79ebf9e00741..69a829ff983ba9 100644
--- a/docs/data/material/customization/breakpoints/breakpoints.md
+++ b/docs/data/material/customization/breakpoints/breakpoints.md
@@ -3,7 +3,7 @@
API that enables the use of breakpoints in a wide variety of contexts.
For optimal user experience, Material Design interfaces need to be able to adapt their layout at various breakpoints.
-MUI uses a **simplified** implementation of the original [specification](https://m2.material.io/design/layout/responsive-layout-grid.html#breakpoints).
+Material UI uses a **simplified** implementation of the original [specification](https://m2.material.io/design/layout/responsive-layout-grid.html#breakpoints).
The breakpoints are used internally in various components to make them responsive,
but you can also take advantage of them
diff --git a/docs/data/material/customization/color/color.md b/docs/data/material/customization/color/color.md
index 02928b597e6892..4a56fcebc77af2 100644
--- a/docs/data/material/customization/color/color.md
+++ b/docs/data/material/customization/color/color.md
@@ -71,7 +71,7 @@ If you are using the default primary and / or secondary shades then by providing
### Tools by the community
-- [mui-theme-creator](https://zenoo.github.io/mui-theme-creator/): A tool to help design and customize themes for the MUI component library. Includes basic site templates to show various components and how they are affected by the theme
+- [mui-theme-creator](https://zenoo.github.io/mui-theme-creator/): A tool to help design and customize themes for the Material UI component library. Includes basic site templates to show various components and how they are affected by the theme
- [Material palette generator](https://m2.material.io/inline-tools/color/): The Material palette generator can be used to generate a palette for any color you input.
## 2014 Material Design color palettes
@@ -80,7 +80,7 @@ These color palettes, originally created by Material Design in 2014, are compris
### Important Terms
-- **Palette**: A palette is a collection of colors, i.e. hues and their shades. MUI provides all colors from the Material Design guidelines.
+- **Palette**: A palette is a collection of colors, i.e. hues and their shades. Material UI provides all colors from the Material Design guidelines.
[This color palette](#color-palette) has been designed with colors that work harmoniously with each other.
- **Hue & Shade**: A single color within the palette is made up of a hue such as "red", and shade, such as "500".
"red 50" is the lightest shade of red (_pink!_), while "red 900" is the darkest.
diff --git a/docs/data/material/customization/density/density.md b/docs/data/material/customization/density/density.md
index a9415dfd5f0b46..bf7bf09d29ed7d 100644
--- a/docs/data/material/customization/density/density.md
+++ b/docs/data/material/customization/density/density.md
@@ -1,6 +1,6 @@
# Density
-How to apply density to MUI components.
+How to apply density to Material UI components.
## Applying density
@@ -35,7 +35,7 @@ The following components have props applying higher density:
## Explore theme density
This tool allows you to apply density via spacing and component props. You can browse
-around and see how this applies to the overall feel of MUI components.
+around and see how this applies to the overall feel of Material UI components.
If you enable high density a custom theme is applied to the docs. This theme is only
for demonstration purposes. You _should not_ apply this theme to your whole application
diff --git a/docs/data/material/customization/how-to-customize/how-to-customize.md b/docs/data/material/customization/how-to-customize/how-to-customize.md
index 3894dcac502ff2..3c8ca0448b916a 100644
--- a/docs/data/material/customization/how-to-customize/how-to-customize.md
+++ b/docs/data/material/customization/how-to-customize/how-to-customize.md
@@ -25,7 +25,7 @@ It can be used with all Material UI components.
{{"demo": "SxProp.js" }}
-#### Overriding nested component styles
+### Overriding nested component styles
To customize a specific part of a component, you can use the class name provided by Material UI inside the `sx` prop. As an example, let's say you want to change the `Slider` component's thumb from a circle to a square.
diff --git a/docs/data/material/customization/palette/CustomColor.tsx b/docs/data/material/customization/palette/CustomColor.tsx
index 61447a28cf34c3..47a0c8bbff768b 100644
--- a/docs/data/material/customization/palette/CustomColor.tsx
+++ b/docs/data/material/customization/palette/CustomColor.tsx
@@ -22,7 +22,7 @@ declare module '@mui/material/styles' {
}
}
-// Update the Button's color prop options
+// @babel-ignore-comment-in-output Update the Button's color prop options
declare module '@mui/material/Button' {
interface ButtonPropsColorOverrides {
neutral: true;
diff --git a/docs/data/material/customization/spacing/spacing.md b/docs/data/material/customization/spacing/spacing.md
index c3d02670b3a836..f1e743c66545d4 100644
--- a/docs/data/material/customization/spacing/spacing.md
+++ b/docs/data/material/customization/spacing/spacing.md
@@ -2,7 +2,7 @@
Use the theme.spacing() helper to create consistent spacing between the elements of your UI.
-MUI uses [a recommended 8px scaling factor](https://m2.material.io/design/layout/understanding-layout.html) by default.
+Material UI uses [a recommended 8px scaling factor](https://m2.material.io/design/layout/understanding-layout.html) by default.
```js
const theme = createTheme();
diff --git a/docs/data/material/customization/theming/theming.md b/docs/data/material/customization/theming/theming.md
index 2b18db5e642c6e..e8fe3b719b720f 100644
--- a/docs/data/material/customization/theming/theming.md
+++ b/docs/data/material/customization/theming/theming.md
@@ -1,6 +1,6 @@
# Theming
-Customize MUI with your theme. You can change the colors, the typography and much more.
+Customize Material UI with your theme. You can change the colors, the typography and much more.
The theme specifies the color of the components, darkness of the surfaces, level of shadow, appropriate opacity of ink elements, etc.
@@ -11,14 +11,14 @@ To promote greater consistency between apps, light and dark theme types are avai
## Theme provider
If you wish to customize the theme, you need to use the `ThemeProvider` component in order to inject a theme into your application.
-However, this is optional; MUI components come with a default theme.
+However, this is optional; Material UI components come with a default theme.
`ThemeProvider` relies on the [context feature of React](https://react.dev/learn/passing-data-deeply-with-context) to pass the theme down to the components, so you need to make sure that `ThemeProvider` is a parent of the components you are trying to customize.
You can learn more about this in [the API section](#themeprovider).
## Theme configuration variables
-Changing the theme configuration variables is the most effective way to match MUI to your needs.
+Changing the theme configuration variables is the most effective way to match Material UI to your needs.
The following sections cover the most important theme variables:
- [`.palette`](/material-ui/customization/palette/)
@@ -33,7 +33,7 @@ You can check out the [default theme section](/material-ui/customization/default
### Custom variables
-When using MUI's theme with [MUI System](/system/getting-started/overview/) or [any other styling solution](/material-ui/guides/interoperability/), it can be convenient to add additional variables to the theme so you can use them everywhere.
+When using Material UI's theme with [MUI System](/system/getting-started/overview/) or [any other styling solution](/material-ui/guides/interoperability/), it can be convenient to add additional variables to the theme so you can use them everywhere.
For instance:
```jsx
@@ -80,7 +80,7 @@ declare module '@mui/material/styles' {
The community has built great tools to build a theme:
-- [mui-theme-creator](https://zenoo.github.io/mui-theme-creator/): A tool to help design and customize themes for the MUI component library. Includes basic site templates to show various components and how they are affected by the theme
+- [mui-theme-creator](https://zenoo.github.io/mui-theme-creator/): A tool to help design and customize themes for the Material UI component library. Includes basic site templates to show various components and how they are affected by the theme
- [Material palette generator](https://m2.material.io/inline-tools/color/): The Material palette generator can be used to generate a palette for any color you input.
## Accessing the theme in a component
diff --git a/docs/data/material/customization/transitions/transitions.md b/docs/data/material/customization/transitions/transitions.md
index f38f426b4fdb96..cef7b16a40a259 100644
--- a/docs/data/material/customization/transitions/transitions.md
+++ b/docs/data/material/customization/transitions/transitions.md
@@ -1,6 +1,6 @@
# Transitions
-The theme key enables you to customize the durations and easings of the various transitions used across MUI components, and offers a utility for creating custom transitions.
+The theme key enables you to customize the durations and easings of the various transitions used across Material UI components, and offers a utility for creating custom transitions.
## API
@@ -87,4 +87,4 @@ const theme = createTheme({
## References
-Check out the [Transitions](/material-ui/transitions/) page to explore the transition components that are included with MUI.
+Check out the [Transitions](/material-ui/transitions/) page to explore the transition components that are included with Material UI.
diff --git a/docs/data/material/customization/typography/typography.md b/docs/data/material/customization/typography/typography.md
index 239a007684fa66..7fac41e1b419d0 100644
--- a/docs/data/material/customization/typography/typography.md
+++ b/docs/data/material/customization/typography/typography.md
@@ -84,13 +84,13 @@ Note that if you want to add additional `@font-face` declarations, you need to u
## Font size
-MUI uses `rem` units for the font size.
+Material UI uses `rem` units for the font size.
The browser `` element default font size is `16px`, but browsers have an option to change this value,
so `rem` units allow us to accommodate the user's settings, resulting in a better accessibility support.
Users change font size settings for all kinds of reasons, from poor eyesight to choosing optimum settings
for devices that can be vastly different in size and viewing distance.
-To change the font-size of MUI you can provide a `fontSize` property.
+To change the font-size of Material UI you can provide a `fontSize` property.
The default value is `14px`.
```js
@@ -163,13 +163,13 @@ Changing the font size can harm accessibility āæļø. Most browsers agree on the
:::
The `theme.typography.htmlFontSize` property is provided for this use case,
-which tells MUI what the font-size on the `` element is.
+which tells Material UI what the font-size on the `` element is.
This is used to adjust the `rem` value so the calculated font-size always match the specification.
```js
const theme = createTheme({
typography: {
- // Tell MUI what's the font-size on the html element is.
+ // Tell Material UI what the font-size on the html element is.
htmlFontSize: 10,
},
});
diff --git a/docs/data/material/customization/z-index/z-index.md b/docs/data/material/customization/z-index/z-index.md
index ce2bf5b03a5a17..a93d8be6d9bd97 100644
--- a/docs/data/material/customization/z-index/z-index.md
+++ b/docs/data/material/customization/z-index/z-index.md
@@ -2,7 +2,7 @@
z-index is the CSS property that helps control layout by providing a third axis to arrange content.
-Several MUI components utilize `z-index`, employing a default z-index scale in MUI
+Several Material UI components utilize `z-index`, employing a default z-index scale
that has been designed to properly layer drawers, modals, snackbars, tooltips, and more.
The `z-index` values start at an arbitrary number, high and specific enough to ideally avoid conflicts:
diff --git a/docs/data/material/discover-more/backers/backers.md b/docs/data/material/discover-more/backers/backers.md
index 4f101c5ffdd635..70ee6a2123125d 100644
--- a/docs/data/material/discover-more/backers/backers.md
+++ b/docs/data/material/discover-more/backers/backers.md
@@ -1,8 +1,8 @@
# Sponsors & Backers
-Support MUI core's development through crowdfunding.
+Support the development of new open-source projects from MUI through crowdfunding.
-The core of MUI is a crowd-funded open-source project, licensed under the permissive MIT license. Sponsorship increases the rate of bug fixes, documentation improvements, and feature development.
+The core of MUI is our crowd-funded open-source projects, licensed under the permissive MIT license. Sponsorship increases the rate of bug fixes, documentation improvements, and feature development.
## MUI's sponsors
@@ -67,21 +67,21 @@ via [OpenCollective](https://opencollective.com/mui)
## FAQ
-### Why is MUI a "crowd-funded open-source project"?
+### Why is Material UI a "crowd-funded open-source project"?
-The core of MUI is open-source to give users great freedom in how they use the software, and to enable the community to have influence over how the project progresses to make it appropriate for a wide range of use-cases. To make MUI a project that users can rely on for years to come, it needs to be well directed and financially sustainable.
+Material UI (as well as Base UI and Joy UI) is open-source to give users great freedom in how they use the software, and to enable the community to have influence over how the project progresses to make it appropriate for a wide range of use-cases. To ensure that MUI's component libraries can stand the test of time for our users, they need to be well directed and financially sustainable.
-The absolute best way to support MUI's ongoing development efforts is to become a sponsor. Crowd-sourced funding enables us to spend the most time directly working on improving MUI core, which you and other MUI users then benefit from.
+The absolute best way to support MUI's ongoing development efforts is to become a sponsor. Crowd-sourced funding enables us to spend the most time directly working on improving MUI's products, which you and other MUI users then benefit from.
### How is sponsorship money spent?
Sponsorship money is used to fund software development, testing, documentation, and releases of the MUI software suite.
-### Is sponsorship required to use MUI?
+### Is sponsorship required to use MUI's products?
-Users are not legally required to give back to the MUI project, but it is in their interest to do so.
+Users are not obligated to give back to MUI, but it is in their interest to do so.
-By significantly reducing the amount of work needed to achieve business goals and reducing running costs, MUI results in huge time and money savings for users. We encourage organizations to contribute a portion of these savings back, enabling the project to advance more rapidly and result in even greater savings for your organization.
+By significantly reducing the amount of work needed to achieve business goals and reducing running costs, MUI's libraries result in huge time and money savings for users. We encourage organizations to contribute a portion of these savings back, enabling the project to advance more rapidly and result in even greater savings for your organization.
### What's the difference between Patreon and OpenCollective?
diff --git a/docs/data/material/discover-more/related-projects/related-projects.md b/docs/data/material/discover-more/related-projects/related-projects.md
index c6c174adba8eb4..95bd9a625d4f4d 100644
--- a/docs/data/material/discover-more/related-projects/related-projects.md
+++ b/docs/data/material/discover-more/related-projects/related-projects.md
@@ -2,7 +2,7 @@
A carefully curated list of third-party tools that expand or build on top of Material UI's component library.
-Developers from the MUI community have built some excellent supplemental tools for working with Material UIāthis page gathers the best that we've seen.
+Developers from the community have built some excellent supplemental tools for working with Material UIāthis page gathers the best that we've seen.
Do you have a project that you think should be featured here?
We'd love to see it.
@@ -56,3 +56,7 @@ Feel free to submit a pull request!
### Sparkline
- [mui-plus](https://mui-plus.vercel.app/components/Sparkline): A sparkline is a tiny chart that can be used to indicate the trend of a value.
+
+## Admin frameworks
+
+- [React Admin](https://github.com/marmelab/react-admin): A frontend Framework for building data-driven applications running in the browser on top of REST/GraphQL APIs.
diff --git a/docs/data/material/discover-more/roadmap/roadmap.md b/docs/data/material/discover-more/roadmap/roadmap.md
index b1c4c13973dc5f..25cf3fae73297c 100644
--- a/docs/data/material/discover-more/roadmap/roadmap.md
+++ b/docs/data/material/discover-more/roadmap/roadmap.md
@@ -4,10 +4,23 @@
## Methodology
-MUI is community driven ā issues that resonate most with the community get the most attention.
+MUI is community-drivenāissues that resonate most with the community get the most attention.
Please **upvote** (š) on GitHub the issues you are most interested in.
Thank you for participating [in the developer survey](/blog/2021-developer-survey-results/).
+## Quarterly roadmap
+
+Our GitHub project's roadmap is where you can learn about what features we're working on, what stage they're at, and when we expect to bring them to you:
+
+- [MUI Core](https://github.com/orgs/mui/projects/18/views/1).
+ This repository focuses on empowering the creation of great design systems with React, as well as providing two ready to use themes (Material Design so far, another one coming in the near future).
+- [MUI X](https://github.com/mui/mui-x/projects/1).
+ This repository focuses on providing advanced React components.
+ Some of the features are MIT licensed, others are available under a commercial license.
+- [MUI Design kits](https://github.com/mui/mui-design-kits/projects/1)
+ This repository focuses on providing the components for designers on Figma and other design tools.
+ It's a great place to leave feedback, feature requests, and ask questions.
+
## Priorities
Here are the top priorities:
@@ -25,19 +38,6 @@ Here are the top priorities:
- **TypeScript.** š We are continuously improving the definitions. The codebase is mostly written in JavaScript with manually authored `.d.ts` definitions. While we do not plan a migration effort as a standalone effort, new modules are written in TypeScript.
- **Accessibility.** āæļø We have relatively [few accessibility issues](https://darekkay.com/blog/accessible-ui-frameworks/), but we are eager to address them all. We would appreciate the help of accessibility experts.
-## Quarterly roadmap
-
-Our GitHub project's roadmap is where you can learn about what features we're working on, what stage they're at, and when we expect to bring them to you:
-
-- [MUI Core](https://github.com/mui/material-ui/projects/25).
- This repository focuses on empowering the creation of great design systems with React, as well as providing two ready to use themes (Material Design so far, another one coming in the near future).
-- [MUI X](https://github.com/mui/mui-x/projects/1).
- This repository focuses on providing advanced React components.
- Some of the features are MIT licensed, others are available under a commercial license.
-- [MUI Design kits](https://github.com/mui/mui-design-kits/projects/1)
- This repository focuses on providing the components for designers on Figma and other design tools.
- It's a great place to leave feedback, feature requests, and ask questions.
-
## New components
Here are the components we will work on being supported in the MUI ecosystem:
diff --git a/docs/data/material/discover-more/showcase/Showcase.js b/docs/data/material/discover-more/showcase/Showcase.js
index eff6f7dca223c0..d4a6e0fdacbb8c 100644
--- a/docs/data/material/discover-more/showcase/Showcase.js
+++ b/docs/data/material/discover-more/showcase/Showcase.js
@@ -45,7 +45,7 @@ const sortFunctions = {
};
export default function Showcase() {
- const [sortFunctionName, setSortFunctionName] = React.useState('dateAdded');
+ const [sortFunctionName, setSortFunctionName] = React.useState('similarWebVisits');
const sortFunction = sortFunctions[sortFunctionName];
const t = useTranslate();
@@ -54,7 +54,7 @@ export default function Showcase() {
};
return (
-
+
Sort by
theme.palette.mode === 'dark' ? 'grey.900' : 'grey.100',
bgcolor: 'currentColor',
diff --git a/docs/data/material/discover-more/showcase/appList.js b/docs/data/material/discover-more/showcase/appList.js
index 580b863a2f8555..5f3ec7e8437d85 100644
--- a/docs/data/material/discover-more/showcase/appList.js
+++ b/docs/data/material/discover-more/showcase/appList.js
@@ -27,7 +27,7 @@ const appList = [
description:
'QuintoAndar is a company that uses technology and ' +
'design to simplify the rental of residential real estate.',
- image: 'quintoandar.png',
+ image: 'quintoandar.jpg',
link: 'https://www.quintoandar.com.br/',
similarWebVisits: 8500,
dateAdded: '2019-05-08',
@@ -47,7 +47,7 @@ const appList = [
description:
'OpenClassrooms is an online platform offering top quality, ' +
'education-to-employment programs and career coaching services for students worldwide. ',
- image: 'openclassrooms.jpg',
+ image: 'openclassrooms.png',
link: 'https://openclassrooms.com/en/',
similarWebVisits: 6000,
dateAdded: '2018-01-34',
@@ -319,16 +319,6 @@ const appList = [
stars: 10,
dateAdded: '2018-01-23',
},
- {
- title: 'DropDesk',
- description:
- 'DropDesk creates unique workspaces & experiences by converting unused space into vibrant ' +
- 'coworking spaces. Meet, work and gain a sense of community.',
- image: 'dropdesk.jpg',
- link: 'https://drop-desk.com/',
- similarWebVisits: 50,
- dateAdded: '2019-01-01',
- },
{
title: 'npm registry browser',
description:
diff --git a/docs/data/material/discover-more/vision/vision.md b/docs/data/material/discover-more/vision/vision.md
index 298787949ffed3..b3da70e7a9e255 100644
--- a/docs/data/material/discover-more/vision/vision.md
+++ b/docs/data/material/discover-more/vision/vision.md
@@ -2,13 +2,13 @@
Our vision is to provide an elegant React implementation of the Material Design guidelines that can be customized to fully match your brand.
-The Material Design guidelines are an incredible starting point, but they do not provide guidance on all aspects or needs of an application. In addition to the guidelines-specific implementation, we want MUI to become whatever is generally useful for application development, all in the spirit of the Material Design guidelines.
+The Material Design guidelines are an incredible starting point, but they do not provide guidance on all aspects or needs of an application. In addition to the guidelines-specific implementation, we want Material UI to become whatever is generally useful for application development, all in the spirit of the Material Design guidelines.
-Therefore, MUI will be not only be an implementation of the Material Design guidelines, but a general use UI library of components that are needed by many. This generalized use doesn't imply any other design methodology. It also means we will have components or combinations that are simply not addressed in the design guidelines.
+Therefore, Material UI will be not only be an implementation of the Material Design guidelines, but a general use UI library of components that are needed by many. This generalized use doesn't imply any other design methodology. It also means we will have components or combinations that are simply not addressed in the design guidelines.
-We will focus on providing all the low-level tools needed to build a rich user-interface with React. Once we implement the Material Design guidelines (which is a bar set quite high), you should be able to take advantage of it for your own business with any style customization needed. We want to see companies succeeding using MUI in a way that matches their brand, close to the material philosophy or not. We don't want them to feel that their UI simply looks like another Google product.
+We will focus on providing all the low-level tools needed to build a rich user-interface with React. Once we implement the Material Design guidelines (which is a bar set quite high), you should be able to take advantage of it for your own business with any style customization needed. We want to see companies succeeding using Material UI in a way that matches their brand, close to the material philosophy or not. We don't want them to feel that their UI simply looks like another Google product.
-From a developer's point of view, we want MUI to:
+From a developer's point of view, we want Material UI to:
- Deliver on fully encapsulated / composable React components.
- Be themeable / customizable.
diff --git a/docs/data/material/getting-started/design-resources/design-resources.md b/docs/data/material/getting-started/design-resources/design-resources.md
index 526aa0ac573bad..76502276b5d48b 100644
--- a/docs/data/material/getting-started/design-resources/design-resources.md
+++ b/docs/data/material/getting-started/design-resources/design-resources.md
@@ -6,7 +6,7 @@
-## MUI resources
+## Material UI resources
### Figma
diff --git a/docs/data/material/getting-started/example-projects/example-projects.md b/docs/data/material/getting-started/example-projects/example-projects.md
index 3cad359fcb93b1..3e72d8d8330362 100644
--- a/docs/data/material/getting-started/example-projects/example-projects.md
+++ b/docs/data/material/getting-started/example-projects/example-projects.md
@@ -53,7 +53,12 @@ If you want to start with a more complete and real-world example, you could take
- All PWA features included (SW, Notifications, deferred installation prompt and more)
- Optimized and scalable performance (all ~100 points on Lighthouse)
-
-
-
### Paid
- [ScaffoldHub](https://scaffoldhub.io/?partner=1):
- Build your complete application with this online tool
- - Choose your framework and library (React & MUI!)
+ - Choose your framework and library (React with Material UI)
- Choose your database (SQL, MongoDB or Firestore)
- Model your database and application with the intuitive GUI
- Generate your application, including a complete scaffolded backend
@@ -87,5 +81,5 @@ If you want to start with a more complete and real-world example, you could take
- [Divjoy](https://divjoy.com?via=material-ui):
- - Create your MUI app in minutes.
+ - Create your Material UI app in minutes.
- You'll get a nice template, authentication, database integration, subscription payments, and more.
diff --git a/docs/data/material/getting-started/faq/faq.md b/docs/data/material/getting-started/faq/faq.md
index 5acc529300417f..6baf6bb437bb90 100644
--- a/docs/data/material/getting-started/faq/faq.md
+++ b/docs/data/material/getting-started/faq/faq.md
@@ -4,11 +4,11 @@
If you still can't find what you're looking for, you can refer to our [support page](/material-ui/getting-started/support/).
-## MUI is awesome. How can I support the project?
+## MUI is awesome. How can I support the company?
There are many ways to support MUI:
-- **Spread the word**. Evangelize MUI by [linking to mui.com](https://mui.com/) on your website, every backlink matters.
+- **Spread the word**. Evangelize MUI's products by [linking to mui.com](https://mui.com/) on your websiteāevery backlink matters.
Follow us on [Twitter](https://twitter.com/MUI_hq), like and retweet the important news. Or just talk about us with your friends.
- **Give us feedback**. Tell us what we're doing well or where we can improve. Please upvote (š) the issues that you are the most interested in seeing solved.
- **Help new users**. You can answer questions on
@@ -20,14 +20,14 @@ There are many ways to support MUI:
- Help [translate](https://translate.mui.com) the documentation.
- [Improve our documentation](https://github.com/mui/material-ui/tree/HEAD/docs), fix bugs, or add features by [submitting a pull request](https://github.com/mui/material-ui/pulls).
- **Support us financially on [OpenCollective](https://opencollective.com/mui)**.
- If you use MUI in a commercial project and would like to support its continued development by becoming a Sponsor, or in a side or hobby project and would like to become a Backer, you can do so through OpenCollective.
+ If you use Material UI in a commercial project and would like to support its continued development by becoming a Sponsor, or in a side or hobby project and would like to become a Backer, you can do so through OpenCollective.
All funds donated are managed transparently, and Sponsors receive recognition in the README and on the MUI home page.
## Why do the fixed positioned elements move when a modal is opened?
Scrolling is blocked as soon as a modal is opened.
This prevents interacting with the background when the modal should be the only interactive content. However, removing the scrollbar can make your **fixed positioned elements** move.
-In this situation, you can apply a global `.mui-fixed` class name to tell MUI to handle those elements.
+In this situation, you can apply a global `.mui-fixed` class name to tell Material UI to handle those elements.
## How can I disable the ripple effect globally?
@@ -52,7 +52,7 @@ const theme = createTheme({
## How can I disable transitions globally?
-MUI uses the same theme helper for creating all its transitions.
+Material UI uses the same theme helper for creating all its transitions.
Therefore you can disable all transitions by overriding the helper in your theme:
```js
@@ -105,10 +105,10 @@ If you choose not to use it, you can still disable transitions and animations by
No, it's not required.
But if you are using the default styled engine (`@mui/styled-engine`) the Emotion dependency comes built in, so carries no additional bundle size overhead.
-Perhaps, however, you're adding some MUI components to an app that already uses another styling solution,
+Perhaps, however, you're adding some Material UI components to an app that already uses another styling solution,
or are already familiar with a different API, and don't want to learn a new one? In that case, head over to the
[Style library interoperability](/material-ui/guides/interoperability/) section,
-where we show how simple it is to restyle MUI components with alternative style libraries.
+where we show how simple it is to restyle Material UI components with alternative style libraries.
## When should I use inline-style vs. CSS?
@@ -126,9 +126,9 @@ We detail the [integration with third-party routing libraries](/material-ui/guid
## How can I access the DOM element?
-All MUI components that should render something in the DOM forward their
+All Material UI components that should render something in the DOM forward their
ref to the underlying DOM component. This means that you can get DOM elements
-by reading the ref attached to MUI components:
+by reading the ref attached to Material UI components:
```jsx
// or a ref setter function
@@ -139,7 +139,7 @@ const ref = React.createRef();
const element = ref.current;
```
-If you're not sure if the MUI component in question forwards its ref you
+If you're not sure if the Material UI component in question forwards its ref you
can check the API documentation under "Props" e.g. the [Button API](/material-ui/api/button/#props)
includes
@@ -249,13 +249,14 @@ Check out the [reference implementations](/material-ui/guides/server-rendering/#
## Why are the colors I am seeing different from what I see here?
The documentation site is using a custom theme. Hence, the color palette is
-different from the default theme that MUI ships. Please refer to [this
+different from the default theme that Material UI ships. Please refer to [this
page](/material-ui/customization/theming/) to learn about theme customization.
## Why does component X require a DOM node in a prop instead of a ref object?
-Components like the [Portal](/base/react-portal/components-api/#portal) or [Popper](/material-ui/api/popper/#props) require a DOM node in the `container` or `anchorEl` prop respectively.
-It seems convenient to simply pass a ref object in those props and let MUI access the current value.
+Components like the [Portal](/base/api/portal/#props) or [Popper](/material-ui/api/popper/#props) require a DOM node in the `container` or `anchorEl` prop respectively.
+It seems convenient to simply pass a ref object in those props and let Material UI access the current value.
+
This works in a simple scenario:
```jsx
@@ -359,13 +360,13 @@ If you are getting the error: `TypeError: Cannot convert a Symbol value to a str
## [v4] Why aren't my components rendering correctly in production builds?
The #1 reason this happens is likely due to class name conflicts once your code is in a production bundle.
-For MUI to work, the `className` values of all components on a page must be generated by a single instance of the [class name generator](/system/styles/advanced/#class-names).
+For Material UI to work, the `className` values of all components on a page must be generated by a single instance of the [class name generator](/system/styles/advanced/#class-names).
To correct this issue, all components on the page need to be initialized such that there is only ever **one class name generator** among them.
You could end up accidentally using two class name generators in a variety of scenarios:
-- You accidentally **bundle** two versions of MUI. You might have a dependency not correctly setting MUI as a peer dependency.
+- You accidentally **bundle** two versions of Material UI. You might have a dependency not correctly setting Material UI as a peer dependency.
- You are using `StylesProvider` for a **subset** of your React tree.
- You are using a bundler and it is splitting code in a way that causes multiple class name generator instances to be created.
@@ -373,7 +374,7 @@ You could end up accidentally using two class name generators in a variety of sc
If you are using webpack with the [SplitChunksPlugin](https://webpack.js.org/plugins/split-chunks-plugin/), try configuring the [`runtimeChunk` setting under `optimizations`](https://webpack.js.org/configuration/optimization/#optimization-runtimechunk).
:::
-Overall, it's simple to recover from this problem by wrapping each MUI application with [`StylesProvider`](/system/styles/api/#stylesprovider) components at the top of their component trees **and using a single class name generator shared among them**.
+Overall, it's simple to recover from this problem by wrapping each Material UI application with [`StylesProvider`](/system/styles/api/#stylesprovider) components at the top of their component trees **and using a single class name generator shared among them**.
### [v4] CSS works only on first load and goes missing
@@ -438,11 +439,11 @@ This generator needs to behave identically on the server and on the client. For
const html = ReactDOMServer.renderToString(
```
-- You need to verify that your client and server are running the **exactly the same version** of MUI.
+- You need to verify that your client and server are running the **exactly the same version** of Material UI.
It is possible that a mismatch of even minor versions can cause styling problems.
To check version numbers, run `npm list @mui/material` in the environment where you build your application and also in your deployment environment.
- You can also ensure the same version in different environments by specifying a specific MUI version in the dependencies of your package.json.
+ You can also ensure the same version in different environments by specifying a specific Material UI version in the dependencies of your package.json.
_example of fix (package.json):_
diff --git a/docs/data/material/getting-started/support/support.md b/docs/data/material/getting-started/support/support.md
index 9df3fc1773ad83..c32cd2e683d4a4 100644
--- a/docs/data/material/getting-started/support/support.md
+++ b/docs/data/material/getting-started/support/support.md
@@ -8,8 +8,8 @@ The community is your first stop for questions and advice about the framework. W
### Stack Overflow
-For crowdsourced answers from expert MUI developers in our community.
-Stack Overflow is also visited from time to time by the maintainers of MUI.
+For crowdsourced answers from expert Material UI developers in our community.
+Stack Overflow is also visited from time to time by the maintainers of Material UI.
[Post a question](https://stackoverflow.com/questions/tagged/mui)
@@ -43,9 +43,9 @@ Stay up to date with the development of the library by following the blog.
### Resources š
-New to MUI? It's easy to learn if you know where to start!
+New to Material UI? It's easy to learn if you know where to start!
-[Learn MUI](/material-ui/getting-started/learn/)
+[Learn Material UI](/material-ui/getting-started/learn/)
### Twitter
@@ -108,13 +108,13 @@ Request a demo
### Custom work š
-Tweak MUI to meet specific requirements. Give us a summary of your needs and we'll help you if we can. We might:
+Tweak MUI's component libraries to meet specific requirements. Give us a summary of your needs and we'll help you if we can. We might:
- Give you an estimate of time and price if the work is straightforward
-- Suggest alternatives that might not require MUI
+- Suggest alternatives that might not require MUI components
- Decline the work due to timing or relevancy
-Note that work must be MUI related.
+Note that work must be MUI-related.
We don't accept general React development work.
Our contracting price is $200/hour or $1,500/day.
diff --git a/docs/data/material/getting-started/supported-platforms/supported-platforms.md b/docs/data/material/getting-started/supported-platforms/supported-platforms.md
index a3d99f9f81d098..6559c6fa26cc73 100644
--- a/docs/data/material/getting-started/supported-platforms/supported-platforms.md
+++ b/docs/data/material/getting-started/supported-platforms/supported-platforms.md
@@ -1,10 +1,10 @@
# Supported platforms
-Learn about the platforms, from modern to old, that are supported by MUI.
+Learn about the platforms, from modern to old, that are supported by Material UI.
## Browser
-MUI supports the latest, stable releases of all major browsers and platforms.
+Material UI supports the latest, stable releases of all major browsers and platforms.
You don't need to provide any JavaScript polyfill as it manages unsupported browser features internally and in isolation.
@@ -17,13 +17,13 @@ You don't need to provide any JavaScript polyfill as it manages unsupported brow
An extensive list can be found in our [.browserlistrc](https://github.com/mui/material-ui/blob/-/.browserslistrc#L12-L27) (check the `stable` entry).
-Because Googlebot uses a web rendering service (WRS) to index the page content, it's critical that MUI supports it.
+Because Googlebot uses a web rendering service (WRS) to index the page content, it's critical that Material UI supports it.
[WRS regularly updates the rendering engine it uses](https://webmasters.googleblog.com/2019/05/the-new-evergreen-googlebot.html).
-You can expect MUI's components to render without major issues.
+You can expect Material UI's components to render without major issues.
### IE 11
-MUI provides **partial** supports for IE 11. Be aware of the following:
+Material UI provides **partial** supports for IE 11. Be aware of the following:
- Some of the components have no support. For instance, the new components, the data grid, the date picker.
- Some of the components have degraded support. For instance, the outlined input border radius is missing, the combobox doesn't remove diacritics, the circular progress animation is wobbling.
@@ -39,7 +39,7 @@ v6 will completely remove the support of IE 11.
-MUI supports [Node.js](https://github.com/nodejs/node) starting with version 12.0 for server-side rendering.
+Material UI supports [Node.js](https://github.com/nodejs/node) starting with version 12.0 for server-side rendering.
The objective is to support Node.js down to the [last version in maintenance mode](https://github.com/nodejs/Release#release-schedule).
### CSS prefixing
@@ -57,10 +57,10 @@ It's a must-do for static pages, but it needs to be put in balance with not doin
-MUI supports the most recent versions of React, starting with ^17.0.0 (the one with event delegation at the React root).
+Material UI supports the most recent versions of React, starting with ^17.0.0 (the one with event delegation at the React root).
Have a look at the older [versions](https://mui.com/versions/) for backward compatibility.
## TypeScript
-MUI requires a minimum version of TypeScript 3.5.
+Material UI requires a minimum version of TypeScript 3.5.
This aims to match the policy of [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped), with the support of the versions of TypeScript that are less than two years old.
diff --git a/docs/data/material/getting-started/templates/blog/Blog.js b/docs/data/material/getting-started/templates/blog/Blog.js
index dc79bf4ea64b62..01b4ee0847228e 100644
--- a/docs/data/material/getting-started/templates/blog/Blog.js
+++ b/docs/data/material/getting-started/templates/blog/Blog.js
@@ -33,7 +33,7 @@ const mainFeaturedPost = {
title: 'Title of a longer featured blog post',
description:
"Multiple lines of text that form the lede, informing new readers quickly and efficiently about what's most interesting in this post's contents.",
- image: 'https://source.unsplash.com/random',
+ image: 'https://source.unsplash.com/random/?blog/',
imageText: 'main image description',
linkText: 'Continue readingā¦',
};
@@ -44,7 +44,7 @@ const featuredPosts = [
date: 'Nov 12',
description:
'This is a wider card with supporting text below as a natural lead-in to additional content.',
- image: 'https://source.unsplash.com/random',
+ image: 'https://source.unsplash.com/random/?blog/',
imageLabel: 'Image Text',
},
{
@@ -52,7 +52,7 @@ const featuredPosts = [
date: 'Nov 11',
description:
'This is a wider card with supporting text below as a natural lead-in to additional content.',
- image: 'https://source.unsplash.com/random',
+ image: 'https://source.unsplash.com/random/?blog/',
imageLabel: 'Image Text',
},
];
diff --git a/docs/data/material/getting-started/templates/blog/Blog.tsx b/docs/data/material/getting-started/templates/blog/Blog.tsx
index dc79bf4ea64b62..01b4ee0847228e 100644
--- a/docs/data/material/getting-started/templates/blog/Blog.tsx
+++ b/docs/data/material/getting-started/templates/blog/Blog.tsx
@@ -33,7 +33,7 @@ const mainFeaturedPost = {
title: 'Title of a longer featured blog post',
description:
"Multiple lines of text that form the lede, informing new readers quickly and efficiently about what's most interesting in this post's contents.",
- image: 'https://source.unsplash.com/random',
+ image: 'https://source.unsplash.com/random/?blog/',
imageText: 'main image description',
linkText: 'Continue readingā¦',
};
@@ -44,7 +44,7 @@ const featuredPosts = [
date: 'Nov 12',
description:
'This is a wider card with supporting text below as a natural lead-in to additional content.',
- image: 'https://source.unsplash.com/random',
+ image: 'https://source.unsplash.com/random/?blog/',
imageLabel: 'Image Text',
},
{
@@ -52,7 +52,7 @@ const featuredPosts = [
date: 'Nov 11',
description:
'This is a wider card with supporting text below as a natural lead-in to additional content.',
- image: 'https://source.unsplash.com/random',
+ image: 'https://source.unsplash.com/random/?blog/',
imageLabel: 'Image Text',
},
];
diff --git a/docs/data/material/guides/api/api.md b/docs/data/material/guides/api/api.md
index cb7914e6f0d182..281dc33320b6de 100644
--- a/docs/data/material/guides/api/api.md
+++ b/docs/data/material/guides/api/api.md
@@ -1,6 +1,6 @@
# API design approach
-We have learned a great deal regarding how MUI is used, and the v1 rewrite allowed us to completely rethink the component API.
+We have learned a great deal regarding how Material UI is used, and the v1 rewrite allowed us to completely rethink the component API.
:::info
API design is hard because you can make it seem simple but it's actually deceptively complex, or make it actually simple but seem complex.
@@ -147,7 +147,7 @@ For example, let's take a button that has different types. Each option has its p
bounds the number of props exposed,
and can easily support new values in the future.
-The MUI components use a combination of the two approaches according to the following rules:
+The Material UI components use a combination of the two approaches according to the following rules:
- A _boolean_ is used when **2** possible values are required.
- An _enum_ is used when **> 2** possible values are required, or if there is the possibility that additional possible values may be required in the future.
diff --git a/docs/data/material/guides/composition/composition.md b/docs/data/material/guides/composition/composition.md
index f92790907ada18..5ab0d24b7c482b 100644
--- a/docs/data/material/guides/composition/composition.md
+++ b/docs/data/material/guides/composition/composition.md
@@ -1,10 +1,10 @@
# Composition
-MUI tries to make composition as easy as possible.
+Material UI tries to make composition as easy as possible.
## Wrapping components
-To provide maximum flexibility and performance, MUI needs a way to know the nature of the child elements a component receives.
+To provide maximum flexibility and performance, Material UI needs a way to know the nature of the child elements a component receives.
To solve this problem, we tag some of the components with a `muiName` static property when needed.
You may, however, need to wrap a component in order to enhance it, which can conflict with the `muiName` solution.
@@ -24,11 +24,11 @@ WrappedIcon.muiName = Icon.muiName;
## Component prop
-MUI allows you to change the root element that will be rendered via a prop called `component`.
+Material UI allows you to change the root element that will be rendered via a prop called `component`.
### How does it work?
-The custom component will be rendered by MUI like this:
+The custom component will be rendered by Material UI like this:
```js
return React.createElement(props.component, props);
@@ -186,14 +186,14 @@ Some of the components need access to the DOM node. This was previously possible
by using `ReactDOM.findDOMNode`. This function is deprecated in favor of `ref` and
ref forwarding. However, only the following component types can be given a `ref`:
-- Any MUI component
+- Any Material UI component
- class components i.e. `React.Component` or `React.PureComponent`
- DOM (or host) components e.g. `div` or `button`
- [React.forwardRef components](https://react.dev/reference/react/forwardRef)
- [React.lazy components](https://react.dev/reference/react/lazy)
- [React.memo components](https://react.dev/reference/react/memo)
-If you don't use one of the above types when using your components in conjunction with MUI, you might see a warning from
+If you don't use one of the above types when using your components in conjunction with Material UI, you might see a warning from
React in your console similar to:
:::warning
@@ -225,7 +225,7 @@ Only the two most common use cases are covered. For more information see [this s
;
```
-To find out if the MUI component you're using has this requirement, check
+To find out if the Material UI component you're using has this requirement, check
out the props API documentation for that component. If you need to forward refs
the description will link to this section.
diff --git a/docs/data/material/guides/content-security-policy/content-security-policy.md b/docs/data/material/guides/content-security-policy/content-security-policy.md
index 7f1bb84b116d8b..5ebb7d26f6f938 100644
--- a/docs/data/material/guides/content-security-policy/content-security-policy.md
+++ b/docs/data/material/guides/content-security-policy/content-security-policy.md
@@ -20,7 +20,7 @@ You can read more about CSP on the [MDN Web Docs](https://developer.mozilla.org/
### Server-Side Rendering (SSR)
-To use CSP with MUI (and emotion), you need to use a nonce.
+To use CSP with Material UI (and Emotion), you need to use a nonce.
A nonce is a randomly generated string that is only used once, therefore you need to add server middleware to generate one on each request.
A CSP nonce is a Base 64 encoded string. You can generate one like this:
diff --git a/docs/data/material/guides/interoperability/interoperability.md b/docs/data/material/guides/interoperability/interoperability.md
index f4a82d7e526277..e76baff4152704 100644
--- a/docs/data/material/guides/interoperability/interoperability.md
+++ b/docs/data/material/guides/interoperability/interoperability.md
@@ -1,6 +1,6 @@
# Style library interoperability
-While you can use the Emotion-based styling solution provided by MUI to style your application, you can also use the one you already know and love (from plain CSS to styled-components).
+While you can use the Emotion-based styling solution provided by Material UI to style your application, you can also use the one you already know and love (from plain CSS to styled-components).
This guide aims to document the most popular alternatives,
but you should find that the principles applied here can be adapted to other libraries.
@@ -53,7 +53,7 @@ export default function PlainCssSlider() {
### CSS injection order ā ļø
-**Note:** Most CSS-in-JS solutions inject their styles at the bottom of the HTML ``, which gives MUI precedence over your custom styles. To remove the need for **!important**, you need to change the CSS injection order. Here's a demo of how it can be done in MUI:
+**Note:** Most CSS-in-JS solutions inject their styles at the bottom of the HTML ``, which gives Material UI precedence over your custom styles. To remove the need for **!important**, you need to change the CSS injection order. Here's a demo of how it can be done in Material UI:
```jsx
import * as React from 'react';
@@ -62,13 +62,13 @@ import { StyledEngineProvider } from '@mui/material/styles';
export default function GlobalCssPriority() {
return (
- {/* Your component tree. Now you can override MUI's styles. */}
+ {/* Your component tree. Now you can override Material UI's styles. */}
);
}
```
-**Note:** If you are using Emotion and have a custom cache in your app, that one will override the one coming from MUI. In order for the injection order to still be correct, you need to add the prepend option. Here is an example:
+**Note:** If you are using Emotion and have a custom cache in your app, that one will override the one coming from Material UI. In order for the injection order to still be correct, you need to add the prepend option. Here is an example:
```jsx
import * as React from 'react';
@@ -83,7 +83,7 @@ const cache = createCache({
export default function PlainCssPriority() {
return (
- {/* Your component tree. Now you can override MUI's styles. */}
+ {/* Your component tree. Now you can override Material UI's styles. */}
);
}
@@ -95,7 +95,7 @@ export default function PlainCssPriority() {
If you attempt to style the Slider,
you will likely need to affect some of the Slider's child elements, for example the thumb.
-In MUI, all child elements have an increased specificity of 2: `.parent .child {}`. When writing overrides, you need to do the same.
+In Material UI, all child elements have an increased specificity of 2: `.parent .child {}`. When writing overrides, you need to do the same.
The following examples override the slider's `thumb` style in addition to the custom styles on the slider itself.
@@ -176,7 +176,7 @@ export default function PlainCssSliderDeep2() {
## Global CSS
Explicitly providing the class names to the component is too much effort?
-[You can target the class names generated by MUI](/system/styles/advanced/).
+[You can target the class names generated by Material UI](/system/styles/advanced/).
[![Edit Button](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/global-classnames-dho8k)
@@ -206,7 +206,7 @@ export default function GlobalCssSlider() {
### CSS injection order ā ļø
-**Note:** Most CSS-in-JS solutions inject their styles at the bottom of the HTML ``, which gives MUI precedence over your custom styles. To remove the need for **!important**, you need to change the CSS injection order. Here's a demo of how it can be done in MUI:
+**Note:** Most CSS-in-JS solutions inject their styles at the bottom of the HTML ``, which gives Material UI precedence over your custom styles. To remove the need for **!important**, you need to change the CSS injection order. Here's a demo of how it can be done in Material UI:
```jsx
import * as React from 'react';
@@ -215,13 +215,13 @@ import { StyledEngineProvider } from '@mui/material/styles';
export default function GlobalCssPriority() {
return (
- {/* Your component tree. Now you can override MUI's styles. */}
+ {/* Your component tree. Now you can override Material UI's styles. */}
);
}
```
-**Note:** If you are using Emotion and have a custom cache in your app, that one will override the one coming from MUI. In order for the injection order to still be correct, you need to add the prepend option. Here is an example:
+**Note:** If you are using Emotion and have a custom cache in your app, that one will override the one coming from Material UI. In order for the injection order to still be correct, you need to add the prepend option. Here is an example:
```jsx
import * as React from 'react';
@@ -236,7 +236,7 @@ const cache = createCache({
export default function GlobalCssPriority() {
return (
- {/* Your component tree. Now you can override MUI's styles. */}
+ {/* Your component tree. Now you can override Material UI's styles. */}
);
}
@@ -248,7 +248,7 @@ export default function GlobalCssPriority() {
If you attempt to style the Slider,
you will likely need to affect some of the Slider's child elements, for example the thumb.
-In MUI, all child elements have an increased specificity of 2: `.parent .child {}`. When writing overrides, you need to do the same.
+In Material UI, all child elements have an increased specificity of 2: `.parent .child {}`. When writing overrides, you need to do the same.
The following example overrides the slider's `thumb` style in addition to the custom styles on the slider itself.
@@ -328,7 +328,7 @@ export default function StyledComponents() {
If you attempt to style the Slider,
you will likely need to affect some of the Slider's child elements, for example the thumb.
-In MUI, all child elements have an increased specificity of 2: `.parent .child {}`. When writing overrides, you need to do the same.
+In Material UI, all child elements have an increased specificity of 2: `.parent .child {}`. When writing overrides, you need to do the same.
The following examples override the slider's `thumb` style in addition to the custom styles on the slider itself.
@@ -367,18 +367,18 @@ export default function StyledComponentsDeep2() {
### Theme
-By using the MUI theme provider, the theme will be available in the theme context
+By using the Material UI theme provider, the theme will be available in the theme context
of the styled engine too (Emotion or styled-components, depending on your configuration).
:::warning
If you are already using a custom theme with styled-components or Emotion,
-it might not be compatible with MUI's theme specification. If it's not
-compatible, you need to render MUI's ThemeProvider first. This will
+it might not be compatible with Material UI's theme specification. If it's not
+compatible, you need to render Material UI's ThemeProvider first. This will
ensure the theme structures are isolated. This is ideal for the progressive adoption
-of MUI's components in the codebase.
+of Material UI's components in the codebase.
:::
-You are encouraged to share the same theme object between MUI and the rest of your project.
+You are encouraged to share the same theme object between Material UI and the rest of your project.
```jsx
const CustomizedSlider = styled(Slider)(
@@ -463,7 +463,7 @@ export default function CssModulesSlider() {
### CSS injection order ā ļø
-**Note:** Most CSS-in-JS solutions inject their styles at the bottom of the HTML ``, which gives MUI precedence over your custom styles. To remove the need for **!important**, you need to change the CSS injection order. Here's a demo of how it can be done in MUI:
+**Note:** Most CSS-in-JS solutions inject their styles at the bottom of the HTML ``, which gives Material UI precedence over your custom styles. To remove the need for **!important**, you need to change the CSS injection order. Here's a demo of how it can be done in Material UI:
```jsx
import * as React from 'react';
@@ -472,13 +472,13 @@ import { StyledEngineProvider } from '@mui/material/styles';
export default function GlobalCssPriority() {
return (
- {/* Your component tree. Now you can override MUI's styles. */}
+ {/* Your component tree. Now you can override Material UI's styles. */}
);
}
```
-**Note:** If you are using Emotion and have a custom cache in your app, that one will override the one coming from MUI. In order for the injection order to still be correct, you need to add the prepend option. Here is an example:
+**Note:** If you are using Emotion and have a custom cache in your app, that one will override the one coming from Material UI. In order for the injection order to still be correct, you need to add the prepend option. Here is an example:
```jsx
import * as React from 'react';
@@ -493,7 +493,7 @@ const cache = createCache({
export default function CssModulesPriority() {
return (
- {/* Your component tree. Now you can override MUI's styles. */}
+ {/* Your component tree. Now you can override Material UI's styles. */}
);
}
@@ -505,8 +505,8 @@ export default function CssModulesPriority() {
If you attempt to style the Slider,
you will likely need to affect some of the Slider's child elements, for example the thumb.
-In MUI, all child elements have an increased specificity of 2: `.parent .child {}`. When writing overrides, you need to do the same.
-It's important to keep in mind that CSS Modules adds an unique id to each class, and that id won't be present on the MUI provided children class. To escape from that, CSS Modules provides a functionality, the `:global` selector.
+In Material UI, all child elements have an increased specificity of 2: `.parent .child {}`. When writing overrides, you need to do the same.
+It's important to keep in mind that CSS Modules adds an unique id to each class, and that id won't be present on the Material UI provided children class. To escape from that, CSS Modules provides a functionality, the `:global` selector.
The following examples override the slider's `thumb` style in addition to the custom styles on the slider itself.
@@ -593,7 +593,7 @@ export default function CssModulesSliderDeep2() {
### The `css` prop
-Emotion's **css()** method works seamlessly with MUI.
+Emotion's **css()** method works seamlessly with Material UI.
{{"demo": "EmotionCSS.js", "defaultCodeOpen": true}}
@@ -612,11 +612,11 @@ It works exactly like styled components. You can [use the same guide](/material-
### Setup
-If you are used to Tailwind CSS and want to use it together with the MUI components, you can start by cloning the [Tailwind CSS](https://github.com/mui/material-ui/tree/master/examples/material-cra-tailwind-ts) example project.
+If you are used to Tailwind CSS and want to use it together with the Material UI components, you can start by cloning the [Tailwind CSS](https://github.com/mui/material-ui/tree/master/examples/material-cra-tailwind-ts) example project.
If you use a different framework, or already have set up your project, follow these steps:
1. Add Tailwind CSS to your project, following the instructions in https://tailwindcss.com/docs/installation.
-2. Remove [Tailwind CSS's preflight](https://tailwindcss.com/docs/preflight) style so it can use the MUI's preflight instead ([CssBaseline](/material-ui/react-css-baseline/)).
+2. Remove [Tailwind CSS's preflight](https://tailwindcss.com/docs/preflight) style so it can use the Material UI's preflight instead ([CssBaseline](/material-ui/react-css-baseline/)).
**tailwind.config.js**
@@ -647,11 +647,11 @@ If you use a different framework, or already have set up your project, follow th
```
Most of the CSS used by Material UI has as specificity of 1, hence this `important` property is unnecessary.
-However, in a few edge cases, MUI uses nested CSS selectors that win over Tailwind CSS.
+However, in a few edge cases, Material UI uses nested CSS selectors that win over Tailwind CSS.
Use this step to help ensure that the [deeper elements](#deeper-elements-5) can always be customized using Tailwind's utility classes.
More details on this option can be found here https://tailwindcss.com/docs/configuration#selector-strategy
-4. Fix the CSS injection order. Most CSS-in-JS solutions inject their styles at the bottom of the HTML ``, which gives MUI precedence over Tailwind CSS. To reduce the need for the `important` property, you need to change the CSS injection order. Here's a demo of how it can be done in MUI:
+4. Fix the CSS injection order. Most CSS-in-JS solutions inject their styles at the bottom of the HTML ``, which gives Material UI precedence over Tailwind CSS. To reduce the need for the `important` property, you need to change the CSS injection order. Here's a demo of how it can be done in Material UI:
```jsx
import * as React from 'react';
@@ -660,13 +660,13 @@ import { StyledEngineProvider } from '@mui/material/styles';
export default function GlobalCssPriority() {
return (
- {/* Your component tree. Now you can override MUI's styles. */}
+ {/* Your component tree. Now you can override Material UI's styles. */}
);
}
```
-**Note:** If you are using Emotion and have a custom cache in your app, it will override the one coming from MUI. In order for the injection order to still be correct, you need to add the prepend option. Here is an example:
+**Note:** If you are using Emotion and have a custom cache in your app, it will override the one coming from Material UI. In order for the injection order to still be correct, you need to add the prepend option. Here is an example:
```jsx
import * as React from 'react';
@@ -681,7 +681,7 @@ const cache = createCache({
export default function PlainCssPriority() {
return (
- {/* Your component tree. Now you can override MUI's styles. */}
+ {/* Your component tree. Now you can override Material UI's styles. */}
);
}
@@ -721,7 +721,7 @@ root.render(
### Usage
-Now it's all set up and you can start using Tailwind CSS on the MUI components!
+Now it's all set up and you can start using Tailwind CSS on the Material UI components!
{{"demo": "StyledComponents.js", "hideToolbar": true}}
@@ -789,10 +789,10 @@ export default function SliderThumbOverrides() {
## ~~JSS~~ TSS
-[JSS](https://cssinjs.org/) itself is no longer supported in MUI however,
+[JSS](https://cssinjs.org/) itself is no longer supported in Material UI, however,
if you like the hook-based API (`makeStyles` ā `useStyles`) that [`react-jss`](https://codesandbox.io/s/j3l06yyqpw) was offering you can opt for [`tss-react`](https://github.com/garronej/tss-react).
-[TSS](https://docs.tss-react.dev) integrates well with MUI and provide a better
+[TSS](https://docs.tss-react.dev) integrates well with Material UI and provide a better
TypeScript support than JSS.
:::info
diff --git a/docs/data/material/guides/localization/localization.md b/docs/data/material/guides/localization/localization.md
index c2bc202ab11e10..8e77ebb30a4d12 100644
--- a/docs/data/material/guides/localization/localization.md
+++ b/docs/data/material/guides/localization/localization.md
@@ -2,7 +2,7 @@
Localization (also referred to as "l10n") is the process of adapting a product or content to a specific locale or market.
-The default locale of MUI is English (United States). If you want to use other locales, follow the instructions below.
+The default locale of Material UI is English (United States). If you want to use other locales, follow the instructions below.
## Locale text
@@ -96,8 +96,8 @@ You can [find the source](https://github.com/mui/material-ui/blob/master/package
To create your own translation, or to customize the English text, copy this file to your project, make any changes needed and import the locale from there.
-Please do consider contributing new translations back to MUI by opening a pull request.
-However, MUI aims to support the [100 most common](https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers) [locales](https://www.ethnologue.com/guides/ethnologue200), we might not accept contributions for locales that are not frequently used, for instance `gl-ES` that has "only" 2.5 million native speakers.
+Please do consider contributing new translations back to Material UI by opening a pull request.
+However, Material UI aims to support the [100 most common](https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers) [locales](https://www.ethnologue.com/guides/ethnologue200), we might not accept contributions for locales that are not frequently used, for instance `gl-ES` that has "only" 2.5 million native speakers.
## RTL Support
diff --git a/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md b/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md
index d31ab7a13ebbf6..bdc3eda53d8b5e 100644
--- a/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md
+++ b/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md
@@ -4,25 +4,23 @@
## Bundle size matters
-MUI takes the bundle size very seriously. Size snapshots are taken
+Material UI's maintainers take bundle size very seriously. Size snapshots are taken
on every commit for every package and critical parts of those packages ([view the latest snapshot](/size-snapshot/)).
Combined with [dangerJS](https://danger.systems/js/) we can inspect
-[detailed bundle size changes](https://github.com/mui/material-ui/pull/14638#issuecomment-466658459) on every pull request.
+[detailed bundle size changes](https://github.com/mui/material-ui/pull/14638#issuecomment-466658459) on every Pull Request.
## When and how to use tree-shaking?
-Tree-shaking of MUI's open source projects, e.g. Material UI works out of the box in modern frameworks.
-MUI exposes its full API on the top-level `@mui` imports.
-If you're using ES6 modules and a bundler that supports tree-shaking ([`webpack` >= 2.x](https://webpack.js.org/guides/tree-shaking/), [`parcel` with a flag](https://en.parceljs.org/cli.html#enable-experimental-scope-hoisting/tree-shaking-support)) you can safely use named imports and still get an optimized bundle size automatically in **production**:
+Tree-shaking Material UI works out of the box in modern frameworks.
+Material UI exposes its full API on the top-level `@mui` imports.
+If you're using ES6 modules and a bundler that supports tree-shaking ([`webpack` >= 2.x](https://webpack.js.org/guides/tree-shaking/), [`parcel` with a flag](https://en.parceljs.org/cli.html#enable-experimental-scope-hoisting/tree-shaking-support)) you can safely use named imports and still get an optimized bundle size automatically:
```js
import { Button, TextField } from '@mui/material';
```
-:::warning
-The following instructions are only needed if you need to optimize the load times in **development** (e.g.Ā needed for icons) or if you are using an older bundler
+ā ļø The following instructions are only needed if you want to optimize your development startup times or if you are using an older bundler
that doesn't support tree-shaking.
-:::
## Development environment
@@ -187,10 +185,10 @@ Modify your `package.json` commands:
```diff
"scripts": {
- "start": "react-scripts start",
-- "build": "react-scripts build",
-- "test": "react-scripts test",
+ "start": "react-app-rewired start",
+- "build": "react-scripts build",
+ "build": "react-app-rewired build",
+- "test": "react-scripts test",
+ "test": "react-app-rewired test",
"eject": "react-scripts eject"
}
@@ -212,19 +210,10 @@ It will perform the following diffs:
## Available bundles
The package published on npm is **transpiled**, with [Babel](https://github.com/babel/babel), to take into account the [supported platforms](/material-ui/getting-started/supported-platforms/).
-In addition, to the default bundle, you can opt-in:
-
-- **Modern bundle**. The modern bundle can be found under the [`/modern` folder](https://unpkg.com/@mui/material/modern/).
- It targets the latest released versions of evergreen browsers (Chrome, Firefox, Safari, Edge).
- This can be used to make separate bundles targeting different browsers.
-- **Legacy bundle**. If you need to support IE 11 you cannot use the default or modern bundle without transpilation.
- However, you can use the legacy bundle found under the [`/legacy` folder](https://unpkg.com/@mui/material/legacy/).
- You don't need any additional polyfills.
-
-### How to use
-
-You can use these bundles at the bundler level with e.g [Webpack's `resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias):
+ā ļø Developers are **strongly discouraged** to import from any of the other bundles directly.
+Otherwise it's not guaranteed that dependencies used also use legacy or modern bundles.
+Instead, use these bundles at the bundler level with e.g [Webpack's `resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias):
```js
{
@@ -241,7 +230,14 @@ You can use these bundles at the bundler level with e.g [Webpack's `resolve.alia
}
```
-:::error
-Developers are **strongly discouraged** to import from these bundles directly in the code because a third-party dependency might import a different bundle.
-So unless you can guarantee that all your dependencies use the same bundle, don't do it.
-:::
+### Modern bundle
+
+The modern bundle can be found under the [`/modern` folder](https://unpkg.com/@mui/material/modern/).
+It targets the latest released versions of evergreen browsers (Chrome, Firefox, Safari, Edge).
+This can be used to make separate bundles targeting different browsers.
+
+### Legacy bundle
+
+If you need to support IE 11 you cannot use the default or modern bundle without transpilation.
+However, you can use the legacy bundle found under the [`/legacy` folder](https://unpkg.com/@mui/material/legacy/).
+You don't need any additional polyfills.
diff --git a/docs/data/material/guides/pickers-migration/pickers-migration.md b/docs/data/material/guides/pickers-migration/pickers-migration.md
index 0456a60b48791c..803e54853c6572 100644
--- a/docs/data/material/guides/pickers-migration/pickers-migration.md
+++ b/docs/data/material/guides/pickers-migration/pickers-migration.md
@@ -87,7 +87,7 @@ function App() {
## Render input
-We introduced a new **required** `renderInput` prop. This simplifies using non-MUI text field input components.
+We introduced a new **required** `renderInput` prop. This simplifies using non-Material UI text field input components.
```jsx
} />
diff --git a/docs/data/material/guides/right-to-left/right-to-left.md b/docs/data/material/guides/right-to-left/right-to-left.md
index 1beb91ae137e68..020e7631286b35 100644
--- a/docs/data/material/guides/right-to-left/right-to-left.md
+++ b/docs/data/material/guides/right-to-left/right-to-left.md
@@ -1,6 +1,6 @@
# Right-to-left
-Right-to-left languages such as Arabic, Persian, or Hebrew are supported. To change the direction of MUI components you must follow the following steps.
+Right-to-left languages such as Arabic, Persian, or Hebrew are supported. To change the direction of Material UI components you must follow the following steps.
## Steps
@@ -59,7 +59,7 @@ In case you are using `jss` (up to v4) or with the legacy `@mui/styles` package,
npm install jss-rtl
```
-Having installed the plugin in your project, MUI components still require it to be loaded by the style engine instance that you use. Find bellow guides on how you can load it.
+Having installed the plugin in your project, Material UI components still require it to be loaded by the style engine instance that you use. Find bellow guides on how you can load it.
### 4. Load the rtl plugin
diff --git a/docs/data/material/guides/routing/routing.md b/docs/data/material/guides/routing/routing.md
index 18e5451c52fcfc..14386149bf2d9c 100644
--- a/docs/data/material/guides/routing/routing.md
+++ b/docs/data/material/guides/routing/routing.md
@@ -20,7 +20,7 @@ For instance, with a `Button` component:
In real-life applications, using a native `` element is rarely enough.
You can improve the user experience by using an enhanced Link component systematically.
-The theme of MUI allows configuring this component once.
+The Material UI theme lets you configure this component once.
For instance, with react-router:
```tsx
@@ -32,7 +32,7 @@ const LinkBehavior = React.forwardRef<
Omit & { href: RouterLinkProps['to'] }
>((props, ref) => {
const { href, ...other } = props;
- // Map href (MUI) -> to (react-router)
+ // Map href (Material UI) -> to (react-router)
return ;
});
diff --git a/docs/data/material/guides/server-rendering/server-rendering.md b/docs/data/material/guides/server-rendering/server-rendering.md
index 5ed55cbc999652..27eaa8cafde72f 100644
--- a/docs/data/material/guides/server-rendering/server-rendering.md
+++ b/docs/data/material/guides/server-rendering/server-rendering.md
@@ -5,9 +5,9 @@
When the server receives the request, it renders the required component(s) into an HTML string, and then sends it as a response to the client.
From that point on, the client takes over rendering duties.
-## MUI on the server
+## Material UI on the server
-MUI was designed from the ground-up with the constraint of rendering on the server, but it's up to you to make sure it's correctly integrated.
+Material UI was designed from the ground-up with the constraint of rendering on the server, but it's up to you to make sure it's correctly integrated.
It's important to provide the page with the required CSS, otherwise the page will render with just the HTML then wait for the CSS to be injected by the client, causing it to flicker (FOUC).
To inject the style down to the client, we need to:
@@ -88,7 +88,7 @@ inside a [`CacheProvider`](https://emotion.sh/docs/cache-provider) and [`ThemePr
The key step in server-side rendering is to render the initial HTML of the component **before** we send it to the client-side. To do this, we use [ReactDOMServer.renderToString()](https://react.dev/reference/react-dom/server/renderToString).
-MUI is using Emotion as its default styled engine.
+Material UI uses Emotion as its default styled engine.
We need to extract the styles from the Emotion instance.
For this, we need to share the same cache configuration for both the client and server:
diff --git a/docs/data/material/guides/shadow-dom/shadow-dom.md b/docs/data/material/guides/shadow-dom/shadow-dom.md
index 49ad539adb78d3..3cdd1658cf88ac 100644
--- a/docs/data/material/guides/shadow-dom/shadow-dom.md
+++ b/docs/data/material/guides/shadow-dom/shadow-dom.md
@@ -34,7 +34,7 @@ ReactDOM.createRoot(shadowRootElement).render(
### 2. Theme
-MUI components like `Menu`, `Dialog`, `Popover` and others use [`Portal`](/material-ui/react-portal/) to render a new "subtree" in a container outside of current DOM hierarchy.
+Material UI components like `Menu`, `Dialog`, `Popover` and others use [`Portal`](/material-ui/react-portal/) to render a new "subtree" in a container outside of current DOM hierarchy.
By default, this container is `document.body`.
But since the styles are applied only inside of the Shadow DOM, we need to render portals inside the Shadow DOM container as well:
diff --git a/docs/data/material/guides/styled-engine/styled-engine.md b/docs/data/material/guides/styled-engine/styled-engine.md
index c44955958339d9..3eb503dfb7f222 100644
--- a/docs/data/material/guides/styled-engine/styled-engine.md
+++ b/docs/data/material/guides/styled-engine/styled-engine.md
@@ -2,9 +2,9 @@
Configuring your preferred styling library.
-The default style library used for generating CSS styles for MUI components is [emotion](https://github.com/emotion-js/emotion).
-All of the MUI components rely on the `styled()` API to inject CSS into the page.
-This API is supported by multiple popular styling libraries, which makes it possible to switch between them in MUI.
+The default style library used for generating CSS styles for Material UI components is [Emotion](https://github.com/emotion-js/emotion).
+All of the Material UI components rely on the `styled()` API to inject CSS into the page.
+This API is supported by multiple popular styling libraries, which makes it possible to switch between them in Material UI.
## How to switch to styled-components
@@ -120,7 +120,7 @@ This package-swap approach is identical to the replacement of React with [Preact
Having more than one styling libraries could introduce unnecessary complexity to your project. You should have a very good reason to do this.
:::
-Material UI can coexist with other libraries that depend on emotion or styled-components. To do that, render Material UI's `ThemeProvider` as an inner provider and use the `THEME_ID` to store the theme.
+Material UI, starting from [v5.12.0](https://github.com/mui/material-ui/releases/tag/v5.12.0), can coexist with other libraries that depend on emotion or styled-components. To do that, render Material UI's `ThemeProvider` as an inner provider and use the `THEME_ID` to store the theme.
```js
import { ThemeProvider, THEME_ID, createTheme } from '@mui/material/styles';
@@ -141,6 +141,10 @@ function App() {
The theme of Material UI will be separated from the other library, so when you use APIs such as `styled`, `sx` prop, and `useTheme`, you will be able to access Material UI's theme like you normally would.
+### Minimum version
+
+[Theme scoping](https://github.com/mui/material-ui/pull/36664) has been added to Material UI v5.12.0, so be sure you're running at that version or higher.
+
### Using with [Theme UI](https://theme-ui.com/)
Render Material UI's theme provider below Theme UI's provider and assign the material theme to the `THEME_ID` property.
diff --git a/docs/data/material/guides/testing/testing.md b/docs/data/material/guides/testing/testing.md
index 9dfa791361a1c5..a1f96498dabfde 100644
--- a/docs/data/material/guides/testing/testing.md
+++ b/docs/data/material/guides/testing/testing.md
@@ -4,18 +4,18 @@
## Userspace
-It's generally recommended to test your application without tying the tests too closely to MUI.
-This is how MUI components are tested internally.
+It's generally recommended to test your application without tying the tests too closely to Material UI.
+This is how Material UI components are tested internally.
A library that has a first-class API for this approach is [`@testing-library/react`](https://testing-library.com/docs/react-testing-library/intro/).
-For example, when rendering a `TextField` your test should not need to query for the specific MUI instance of the `TextField` but rather for the `input`, or `[role="textbox"]`.
+For example, when rendering a `TextField` your test should not need to query for the specific Material UI instance of the `TextField` but rather for the `input`, or `[role="textbox"]`.
-By not relying on the React component tree you make your test more robust against internal changes in MUI or, if you need snapshot testing, adding additional wrapper components such as context providers.
+By not relying on the React component tree you make your test more robust against internal changes in Material UI or, if you need snapshot testing, adding additional wrapper components such as context providers.
We don't recommend snapshot testing though.
["Effective snapshot testing" by Kent C. Dodds](https://kentcdodds.com/blog/effective-snapshot-testing) goes into more details why snapshot testing might be misleading for React component tests.
## Internal
-MUI has **a wide range** of tests so we can
+MUI has **a wide range** of tests for Material UI so we can
iterate with confidence on the components, for instance, the visual regression tests provided by [Argos-CI](https://app.argos-ci.com/mui/material-ui/builds) have proven to be really helpful.
To learn more about the internal tests, you can have a look at the [README](https://github.com/mui/material-ui/blob/HEAD/test/README.md).
diff --git a/docs/data/material/guides/understand-mui-packages/understand-mui-packages.md b/docs/data/material/guides/understand-mui-packages/understand-mui-packages.md
index c4b45d32d43537..5e68818d72500f 100644
--- a/docs/data/material/guides/understand-mui-packages/understand-mui-packages.md
+++ b/docs/data/material/guides/understand-mui-packages/understand-mui-packages.md
@@ -1,6 +1,6 @@
# Understanding MUI packages
-An overview of the MUI packages and the relationships between them.
+An overview of MUI's packages and the relationships between them.
## Overview
diff --git a/docs/data/material/migration/migration-v4/v5-style-changes.md b/docs/data/material/migration/migration-v4/v5-style-changes.md
index 1b095b604aa2b4..d35f398c6eb0c4 100644
--- a/docs/data/material/migration/migration-v4/v5-style-changes.md
+++ b/docs/data/material/migration/migration-v4/v5-style-changes.md
@@ -177,7 +177,7 @@ export default function GlobalCssPriority() {
return (
{/* Inject Emotion before JSS */}
- {/* Your component tree. Now you can override MUI's styles. */}
+ {/* Your component tree. Now you can override Material UI's styles. */}
);
}
diff --git a/docs/data/styles/advanced/advanced.md b/docs/data/styles/advanced/advanced.md
index 8afd6fa80cd79c..65db91794e0b1d 100644
--- a/docs/data/styles/advanced/advanced.md
+++ b/docs/data/styles/advanced/advanced.md
@@ -2,7 +2,7 @@
This section covers more advanced usage of @mui/styles.
-> ā ļø `@mui/styles` is the _**legacy**_ styling solution for MUI.
+> ā ļø `@mui/styles` is the _**legacy**_ styling solution for Material UI.
> It depends on [JSS](https://cssinjs.org/) as a styling solution, which is not used in the `@mui/material` anymore, deprecated in v5.
> If you don't want to have both Emotion & JSS in your bundle, please refer to the [`@mui/system`](/system/getting-started/overview/) documentation which is the recommended alternative.
@@ -12,7 +12,7 @@
Add a `ThemeProvider` to the top level of your app to pass a theme down the React component tree. Then, you can access the theme object in style functions.
-> This example creates a theme object for custom-built components. If you intend to use some of the MUI's components you need to provide a richer theme structure using the `createTheme()` method. Head to the [theming section](/material-ui/customization/theming/) to learn how to build your custom MUI theme.
+> This example creates a theme object for custom-built components. If you intend to use some of Material UI's components you need to provide a richer theme structure using the `createTheme()` method. Head to the [theming section](/material-ui/customization/theming/) to learn how to build your custom Material UI theme.
```jsx
import { ThemeProvider } from '@mui/styles';
@@ -175,7 +175,7 @@ function Parent() {
JSS uses plugins to extend its core, allowing you to cherry-pick the features you need,
and only pay the performance overhead for what you are using.
-Not all the plugins are available in MUI by default. The following (which is a subset of
+Not all the plugins are available in Material UI by default. The following (which is a subset of
[jss-preset-default](https://cssinjs.org/jss-preset-default/)) are included:
- [jss-plugin-rule-value-function](https://cssinjs.org/jss-plugin-rule-value-function/)
@@ -243,7 +243,7 @@ import { StylesProvider } from '@mui/styles';
{/* Your component tree.
- Styled components can override MUI's styles. */}
+ Styled components can override Material UI's styles. */}
;
```
@@ -453,7 +453,7 @@ const className = `${productionPrefix}${identifier}`;
However, when the following conditions are met, the class names are **deterministic**:
- Only one theme provider is used (**No theme nesting**)
-- The style sheet has a name that starts with `Mui` (all MUI components).
+- The style sheet has a name that starts with `Mui` (all Material UI components).
- The `disableGlobal` option of the [class name generator](/system/styles/api/#creategenerateclassname-options-class-name-generator) is `false` (the default).
## Global CSS
diff --git a/docs/data/styles/api/api.md b/docs/data/styles/api/api.md
index 9621458ddc121d..7f02a0efcd0069 100644
--- a/docs/data/styles/api/api.md
+++ b/docs/data/styles/api/api.md
@@ -6,7 +6,7 @@ title: Styles API
The API reference of @mui/styles.
-> ā ļø `@mui/styles` is the _**legacy**_ styling solution for MUI.
+> ā ļø `@mui/styles` is the _**legacy**_ styling solution for Material UI.
> It depends on [JSS](https://cssinjs.org/) as a styling solution, which is not used in the `@mui/material` anymore, deprecated in v5.
> If you don't want to have both Emotion & JSS in your bundle, please refer to the [`@mui/system`](/system/getting-started/overview/) documentation which is the recommended alternative.
@@ -234,7 +234,7 @@ It should preferably be used at **the root of your component tree**.
| children \* | node | | Your component tree. |
| disableGeneration | bool | false | You can disable the generation of the styles with this option. It can be useful when traversing the React tree outside of the HTML rendering step on the server. Let's say you are using react-apollo to extract all the queries made by the interface server-side. You can significantly speed up the traversal with this prop. |
| generateClassName | func | | JSS's class name generator. |
-| injectFirst | bool | false | By default, the styles are injected last in the `` element of the page. As a result, they gain more specificity than any other style sheet. If you want to override MUI's styles, set this prop. |
+| injectFirst | bool | false | By default, the styles are injected last in the `` element of the page. As a result, they gain more specificity than any other style sheet. If you want to override Material UI's styles, set this prop. |
| jss | object | | JSS's instance. |
### Examples
diff --git a/docs/data/styles/basics/AdaptingHOC.tsx b/docs/data/styles/basics/AdaptingHOC.tsx
index ac19f1c174af6b..9c8a039cdb28c5 100644
--- a/docs/data/styles/basics/AdaptingHOC.tsx
+++ b/docs/data/styles/basics/AdaptingHOC.tsx
@@ -24,8 +24,8 @@ const styles = {
interface MyButtonRawProps {
color: 'red' | 'blue';
}
-// These are the props available inside MyButtonRaw
-// They're different from MyButtonRawProps which are the props available for dynamic styling.
+// @babel-ignore-comment-in-output These are the props available inside MyButtonRaw
+// @babel-ignore-comment-in-output They're different from MyButtonRawProps which are the props available for dynamic styling.
type MyButtonRawInnerProps = MyButtonRawProps & WithStyles;
function MyButtonRaw(
diff --git a/docs/data/styles/basics/basics.md b/docs/data/styles/basics/basics.md
index a1abc4e394664d..081bd359a2ae26 100644
--- a/docs/data/styles/basics/basics.md
+++ b/docs/data/styles/basics/basics.md
@@ -1,24 +1,24 @@
# @mui/styles (LEGACY)
-The legacy styling solution of MUI.
+The legacy styling solution for Material UI.
-> ā ļø `@mui/styles` is the _**legacy**_ styling solution for MUI.
+> ā ļø `@mui/styles` is the _**legacy**_ styling solution for Material UI.
> It depends on [JSS](https://cssinjs.org/) as a styling solution, which is not used in the `@mui/material` anymore, deprecated in v5.
> If you don't want to have both Emotion & JSS in your bundle, please refer to the [`@mui/system`](/system/getting-started/overview/) documentation which is the recommended alternative.
> ā ļø `@mui/styles` is not compatible with [React.StrictMode](https://react.dev/reference/react/StrictMode) or React 18.
-MUI aims to provide a strong foundation for building dynamic UIs.
-For the sake of simplicity, **we expose the styling solution used in MUI components** as the `@mui/styles` package.
-You can use it, but you don't have to, since MUI is also [interoperable with](/material-ui/guides/interoperability/) all the other major styling solutions.
+Material UI aims to provide a strong foundation for building dynamic UIs.
+For the sake of simplicity, **we expose the styling solution used in Material UI components** as the `@mui/styles` package.
+You can use it, but you don't have to, since Material UI is also [interoperable with](/material-ui/guides/interoperability/) all the other major styling solutions.
-## Why use MUI's styling solution?
+## Why use Material UI's styling solution?
-In previous versions, MUI has used [Less](https://lesscss.org/), and then a custom inline-style solution to write the component styles, but these approaches proved to be limited.
+In previous versions, Material UI has used [Less](https://lesscss.org/), and then a custom inline-style solution to write the component styles, but these approaches proved to be limited.
[A _CSS-in-JS_ solution](https://github.com/oliviertassinari/a-journey-toward-better-style) overcomes many of those limitations,
and **unlocks many great features** (theme nesting, dynamic styles, self-support, etc.).
-MUI's styling solution is inspired by many other styling libraries such as [styled-components](https://styled-components.com/) and [Emotion](https://emotion.sh/).
+Material UI's styling solution is inspired by many other styling libraries such as [styled-components](https://styled-components.com/) and [Emotion](https://emotion.sh/).
- š
You can expect [the same advantages](https://styled-components.com/docs/basics#motivation) as styled-components.
@@ -27,7 +27,7 @@ MUI's styling solution is inspired by many other styling libraries such as [styl
- š It's [blazing fast](https://github.com/mui/material-ui/tree/master/benchmark/server#material-uistyles).
- š§© It's extensible via a [plugin](https://github.com/cssinjs/jss/blob/master/docs/plugins.md) API.
- ā”ļø It uses [JSS](https://github.com/cssinjs/jss) at its core ā a [high performance](https://github.com/cssinjs/jss/blob/master/docs/performance.md) JavaScript to CSS compiler which works at runtime and server-side.
-- š¦ Less than [15 KB gzipped](https://bundlephobia.com/package/@mui/styles); and no bundle size increase if used alongside MUI.
+- š¦ Less than [15 KB gzipped](https://bundlephobia.com/package/@mui/styles); and no bundle size increase if used alongside Material UI.
## Installation
@@ -218,7 +218,7 @@ const useStyles = makeStyles((theme) => ({
## Using the theme context
-Starting from v5, MUI no longer uses JSS as its default styling solution. If you still want to use the utilities exported by `@mui/styles` and they depend on the `theme`, you will need to provide the `theme` as part of the context. For this, you can use the `ThemeProvider` component available in `@mui/styles`, or, if you are already using `@mui/material`, you should use the one exported from `@mui/material/styles` so that the same `theme` is available for components from '@mui/material'.
+Starting from v5, Material UI no longer uses JSS as its default styling solution. If you still want to use the utilities exported by `@mui/styles` and they depend on the `theme`, you will need to provide the `theme` as part of the context. For this, you can use the `ThemeProvider` component available in `@mui/styles`, or, if you are already using `@mui/material`, you should use the one exported from `@mui/material/styles` so that the same `theme` is available for components from '@mui/material'.
```jsx
import { makeStyles } from '@mui/styles';
diff --git a/docs/data/system/components/box/box.md b/docs/data/system/components/box/box.md
index d8b6cdcda96115..a8b903804e94f7 100644
--- a/docs/data/system/components/box/box.md
+++ b/docs/data/system/components/box/box.md
@@ -38,7 +38,7 @@ For instance, you can change the margin this way.
However, sometimes you have to target the underlying DOM element.
As an example, you may want to change the border of the Button.
The Button component defines its own styles. CSS inheritance doesn't help.
-To workaround the problem, you can use the [`sx`](/system/getting-started/the-sx-prop/) prop directly on the child if it is a MUI component.
+To workaround the problem, you can use the [`sx`](/system/getting-started/the-sx-prop/) prop directly on the child if it is an MUI component.
```diff
-
diff --git a/docs/data/system/pages.ts b/docs/data/system/pages.ts
index 433d0a57647d1c..b36f6d6ef74fb9 100644
--- a/docs/data/system/pages.ts
+++ b/docs/data/system/pages.ts
@@ -44,7 +44,7 @@ const pages = [
],
},
{
- title: 'Component API',
+ title: 'APIs',
pathname: '/system/api',
icon: standardNavIcons.CodeIcon,
children: pagesApi,
@@ -68,7 +68,7 @@ const pages = [
children: [
{ pathname: '/system/styles/basics' },
{ pathname: '/system/styles/advanced' },
- { pathname: '/system/styles/api', title: 'API' },
+ { pathname: '/system/styles/api', title: 'APIs' },
],
},
];
diff --git a/docs/notifications.json b/docs/notifications.json
index 7de9d945d7b665..54f9f2a6009784 100644
--- a/docs/notifications.json
+++ b/docs/notifications.json
@@ -4,14 +4,14 @@
"title": "Check out Base UI today š„",
"text": "Love Material UI, but don't need Material Design? Try Base UI, the new \"unstyled\" alternative. Read more in this announcement ."
},
- {
- "id": 73,
- "title": "Date and Time Pickers revamped ",
- "text": "Discover the exciting new features landing now with v6 beta."
- },
{
"id": 74,
"title": "Introducing MUI X v6.0.0 ",
"text": "Explore what's new and what's next in the new stable version of the advanced components."
+ },
+ {
+ "id": 75,
+ "title": "Try the new time picker UI now ",
+ "text": "The new time-picking experience is designed for desktops, and it's available on the Time Picker as well as a standalone component ."
}
]
diff --git a/docs/package.json b/docs/package.json
index 7c7ecfa7b018fa..f1c5b7f318db55 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -20,33 +20,33 @@
"link-check": "node ./scripts/reportBrokenLinks.js"
},
"dependencies": {
- "@babel/core": "^7.21.3",
+ "@babel/core": "^7.21.4",
"@babel/plugin-transform-object-assign": "^7.18.6",
"@babel/runtime-corejs2": "^7.21.0",
- "@docsearch/react": "^3.3.3",
- "@emotion/cache": "^11.10.7",
- "@emotion/react": "^11.10.6",
+ "@docsearch/react": "^3.3.4",
+ "@emotion/cache": "^11.10.8",
+ "@emotion/react": "^11.10.8",
"@emotion/server": "^11.10.0",
- "@emotion/styled": "^11.10.6",
+ "@emotion/styled": "^11.10.8",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.2.1",
"@fortawesome/react-fontawesome": "^0.2.0",
- "@mui/base": "5.0.0-alpha.127",
- "@mui/docs": "^5.12.0",
+ "@mui/base": "5.0.0-alpha.128",
+ "@mui/docs": "^5.12.3",
"@mui/icons-material": "^5.11.16",
- "@mui/joy": "5.0.0-alpha.77",
- "@mui/lab": "5.0.0-alpha.128",
+ "@mui/joy": "5.0.0-alpha.78",
+ "@mui/lab": "5.0.0-alpha.129",
"@mui/markdown": "^5.0.0",
- "@mui/material": "^5.12.2",
- "@mui/material-next": "6.0.0-alpha.83",
- "@mui/styled-engine": "^5.12.0",
+ "@mui/material": "^5.12.3",
+ "@mui/material-next": "6.0.0-alpha.84",
+ "@mui/styled-engine": "^5.12.3",
"@mui/styled-engine-sc": "^5.12.0",
- "@mui/styles": "^5.12.0",
- "@mui/system": "^5.12.1",
+ "@mui/styles": "^5.12.3",
+ "@mui/system": "^5.12.3",
"@mui/types": "^7.2.4",
- "@mui/x-data-grid": "6.2.0",
- "@mui/x-data-grid-generator": "6.2.0",
- "@mui/x-data-grid-pro": "6.2.0",
+ "@mui/x-data-grid": "6.3.0",
+ "@mui/x-data-grid-generator": "6.3.0",
+ "@mui/x-data-grid-pro": "6.3.0",
"@mui/x-date-pickers": "6.2.0",
"@mui/x-date-pickers-pro": "6.2.0",
"@mui/x-license-pro": "6.0.4",
@@ -113,7 +113,7 @@
"recharts": "2.4.3",
"rimraf": "^3.0.2",
"styled-components": "^5.3.10",
- "stylis": "^4.1.3",
+ "stylis": "^4.1.4",
"stylis-plugin-rtl": "^2.1.1",
"stylis-plugin-rtl-sc": "npm:stylis-plugin-rtl@^1.1.0",
"webfontloader": "^1.6.28",
@@ -121,7 +121,7 @@
},
"devDependencies": {
"@babel/plugin-transform-react-constant-elements": "^7.21.3",
- "@babel/preset-typescript": "^7.21.0",
+ "@babel/preset-typescript": "^7.21.4",
"@types/marked": "^4.0.8",
"@types/recharts": "^2.0.0",
"cross-fetch": "^3.1.5",
diff --git a/docs/pages/about.tsx b/docs/pages/about.tsx
index a8f51cd6cc20e3..b91c548bfea2c2 100644
--- a/docs/pages/about.tsx
+++ b/docs/pages/about.tsx
@@ -444,6 +444,15 @@ const teamMembers: Array = [
locationCountry: 'gb',
about: 'š§āāļø Amateur indoor climber & ex-philosophy geek',
},
+ {
+ src: '/static/branding/about/romain.png',
+ name: 'Romain GrƩgoire',
+ title: 'MUI X Engineer',
+ location: 'MontrƩal, Canada',
+ locationCountry: 'ca',
+ about: 'Open-source tinkerer',
+ github: 'romgrk',
+ },
];
const contributors = [
diff --git a/docs/pages/base/api/badge.json b/docs/pages/base/api/badge.json
index c9e0c49d9f8232..92b68784d9ec9a 100644
--- a/docs/pages/base/api/badge.json
+++ b/docs/pages/base/api/badge.json
@@ -2,7 +2,6 @@
"props": {
"badgeContent": { "type": { "name": "node" } },
"children": { "type": { "name": "node" } },
- "component": { "type": { "name": "elementType" } },
"invisible": { "type": { "name": "bool" }, "default": "false" },
"max": { "type": { "name": "number" }, "default": "99" },
"showZero": { "type": { "name": "bool" }, "default": "false" },
diff --git a/docs/pages/base/api/form-control.json b/docs/pages/base/api/form-control.json
index 90270aad3d0c48..2e4d3df59273b4 100644
--- a/docs/pages/base/api/form-control.json
+++ b/docs/pages/base/api/form-control.json
@@ -1,7 +1,6 @@
{
"props": {
"children": { "type": { "name": "union", "description": "node | func" } },
- "component": { "type": { "name": "elementType" } },
"disabled": { "type": { "name": "bool" }, "default": "false" },
"error": { "type": { "name": "bool" }, "default": "false" },
"onChange": { "type": { "name": "func" } },
diff --git a/docs/pages/base/api/input.json b/docs/pages/base/api/input.json
index f35a4b3eaf4a6a..980af136f07548 100644
--- a/docs/pages/base/api/input.json
+++ b/docs/pages/base/api/input.json
@@ -3,7 +3,6 @@
"autoComplete": { "type": { "name": "string" } },
"autoFocus": { "type": { "name": "bool" } },
"className": { "type": { "name": "string" } },
- "component": { "type": { "name": "elementType" } },
"defaultValue": { "type": { "name": "any" } },
"disabled": { "type": { "name": "bool" } },
"endAdornment": { "type": { "name": "node" } },
diff --git a/docs/pages/base/api/menu-item.json b/docs/pages/base/api/menu-item.json
index ab7b068a921cb3..7a56472ba90e64 100644
--- a/docs/pages/base/api/menu-item.json
+++ b/docs/pages/base/api/menu-item.json
@@ -1,6 +1,5 @@
{
"props": {
- "component": { "type": { "name": "elementType" } },
"label": { "type": { "name": "string" } },
"slotProps": {
"type": { "name": "shape", "description": "{ root?: func | object }" },
diff --git a/docs/pages/base/api/menu.json b/docs/pages/base/api/menu.json
index e6a9427cc5aeae..ce527b89a2f5a8 100644
--- a/docs/pages/base/api/menu.json
+++ b/docs/pages/base/api/menu.json
@@ -7,7 +7,6 @@
"description": "HTML element | object | func"
}
},
- "component": { "type": { "name": "elementType" } },
"onOpenChange": { "type": { "name": "func" } },
"open": { "type": { "name": "bool" }, "default": "false" },
"slotProps": {
diff --git a/docs/pages/base/api/modal.json b/docs/pages/base/api/modal.json
index 11a7469bb0d474..2993d0ee3210bf 100644
--- a/docs/pages/base/api/modal.json
+++ b/docs/pages/base/api/modal.json
@@ -3,7 +3,6 @@
"children": { "type": { "name": "custom", "description": "element" }, "required": true },
"open": { "type": { "name": "bool" }, "required": true },
"closeAfterTransition": { "type": { "name": "bool" }, "default": "false" },
- "component": { "type": { "name": "elementType" } },
"container": { "type": { "name": "union", "description": "HTML element | func" } },
"disableAutoFocus": { "type": { "name": "bool" }, "default": "false" },
"disableEnforceFocus": { "type": { "name": "bool" }, "default": "false" },
diff --git a/docs/pages/base/api/option-group.json b/docs/pages/base/api/option-group.json
index 693a23180d66c3..f3d65de7f53eb5 100644
--- a/docs/pages/base/api/option-group.json
+++ b/docs/pages/base/api/option-group.json
@@ -1,6 +1,5 @@
{
"props": {
- "component": { "type": { "name": "elementType" } },
"disabled": { "type": { "name": "bool" }, "default": "false" },
"label": { "type": { "name": "node" } },
"slotProps": {
diff --git a/docs/pages/base/api/option.json b/docs/pages/base/api/option.json
index b88094c4f9055f..3c5bfc442c44e2 100644
--- a/docs/pages/base/api/option.json
+++ b/docs/pages/base/api/option.json
@@ -1,7 +1,6 @@
{
"props": {
"value": { "type": { "name": "any" }, "required": true },
- "component": { "type": { "name": "elementType" } },
"disabled": { "type": { "name": "bool" }, "default": "false" },
"label": { "type": { "name": "string" } },
"slotProps": {
diff --git a/docs/pages/base/api/select.json b/docs/pages/base/api/select.json
index 156687b5646139..93ce757158b52b 100644
--- a/docs/pages/base/api/select.json
+++ b/docs/pages/base/api/select.json
@@ -1,10 +1,10 @@
{
"props": {
"autoFocus": { "type": { "name": "bool" }, "default": "false" },
- "component": { "type": { "name": "elementType" } },
"defaultListboxOpen": { "type": { "name": "bool" }, "default": "false" },
"defaultValue": { "type": { "name": "any" } },
"disabled": { "type": { "name": "bool" }, "default": "false" },
+ "getOptionAsString": { "type": { "name": "func" }, "default": "defaultOptionStringifier" },
"getSerializedValue": { "type": { "name": "func" } },
"listboxId": { "type": { "name": "string" } },
"listboxOpen": { "type": { "name": "bool" }, "default": "undefined" },
@@ -12,7 +12,6 @@
"name": { "type": { "name": "string" } },
"onChange": { "type": { "name": "func" } },
"onListboxOpenChange": { "type": { "name": "func" } },
- "optionStringifier": { "type": { "name": "func" }, "default": "defaultOptionStringifier" },
"renderValue": { "type": { "name": "func" } },
"slotProps": {
"type": {
diff --git a/docs/pages/base/api/slider.json b/docs/pages/base/api/slider.json
index aaa60301da2625..780c2b61cbeac1 100644
--- a/docs/pages/base/api/slider.json
+++ b/docs/pages/base/api/slider.json
@@ -3,7 +3,6 @@
"aria-label": { "type": { "name": "custom", "description": "string" } },
"aria-labelledby": { "type": { "name": "string" } },
"aria-valuetext": { "type": { "name": "custom", "description": "string" } },
- "component": { "type": { "name": "elementType" } },
"defaultValue": {
"type": { "name": "union", "description": "Array<number> | number" }
},
diff --git a/docs/pages/base/api/snackbar.json b/docs/pages/base/api/snackbar.json
index 411231ca31eb61..a0b22480955a9c 100644
--- a/docs/pages/base/api/snackbar.json
+++ b/docs/pages/base/api/snackbar.json
@@ -1,7 +1,6 @@
{
"props": {
"autoHideDuration": { "type": { "name": "number" }, "default": "null" },
- "component": { "type": { "name": "elementType" } },
"disableWindowBlurListener": { "type": { "name": "bool" }, "default": "false" },
"exited": { "type": { "name": "bool" }, "default": "true" },
"onClose": { "type": { "name": "func" } },
diff --git a/docs/pages/base/api/switch.json b/docs/pages/base/api/switch.json
index 8adc8d2f94b05c..8c47ea4c85e2a2 100644
--- a/docs/pages/base/api/switch.json
+++ b/docs/pages/base/api/switch.json
@@ -1,7 +1,6 @@
{
"props": {
"checked": { "type": { "name": "bool" } },
- "component": { "type": { "name": "elementType" } },
"defaultChecked": { "type": { "name": "bool" } },
"disabled": { "type": { "name": "bool" } },
"onChange": { "type": { "name": "func" } },
diff --git a/docs/pages/base/api/tab-panel.json b/docs/pages/base/api/tab-panel.json
index 7f6090d06aea7f..004d16c071c94d 100644
--- a/docs/pages/base/api/tab-panel.json
+++ b/docs/pages/base/api/tab-panel.json
@@ -1,7 +1,6 @@
{
"props": {
"children": { "type": { "name": "node" } },
- "component": { "type": { "name": "elementType" } },
"slotProps": {
"type": { "name": "shape", "description": "{ root?: func | object }" },
"default": "{}"
diff --git a/docs/pages/base/api/tab.json b/docs/pages/base/api/tab.json
index 0d2fe9214a1b32..8bff7bbd848cc0 100644
--- a/docs/pages/base/api/tab.json
+++ b/docs/pages/base/api/tab.json
@@ -6,7 +6,6 @@
"description": "func | { current?: { focusVisible: func } }"
}
},
- "component": { "type": { "name": "elementType" } },
"disabled": { "type": { "name": "bool" }, "default": "false" },
"onChange": { "type": { "name": "func" } },
"slotProps": {
diff --git a/docs/pages/base/api/table-pagination.json b/docs/pages/base/api/table-pagination.json
index 7fde401a6533c1..1ef6b789fb9033 100644
--- a/docs/pages/base/api/table-pagination.json
+++ b/docs/pages/base/api/table-pagination.json
@@ -4,7 +4,6 @@
"onPageChange": { "type": { "name": "func" }, "required": true },
"page": { "type": { "name": "custom", "description": "integer" }, "required": true },
"rowsPerPage": { "type": { "name": "custom", "description": "integer" }, "required": true },
- "component": { "type": { "name": "elementType" } },
"getItemAriaLabel": {
"type": { "name": "func" },
"default": "function defaultGetAriaLabel(type: ItemAriaLabelType) {\n return `Go to ${type} page`;\n}"
diff --git a/docs/pages/base/api/tabs-list.json b/docs/pages/base/api/tabs-list.json
index e888c35fb22d1b..44664ef547e1de 100644
--- a/docs/pages/base/api/tabs-list.json
+++ b/docs/pages/base/api/tabs-list.json
@@ -1,7 +1,6 @@
{
"props": {
"children": { "type": { "name": "node" } },
- "component": { "type": { "name": "elementType" } },
"slotProps": {
"type": { "name": "shape", "description": "{ root?: func | object }" },
"default": "{}"
diff --git a/docs/pages/base/api/tabs.json b/docs/pages/base/api/tabs.json
index 7999fc0783bbd7..d615a62fc12d7a 100644
--- a/docs/pages/base/api/tabs.json
+++ b/docs/pages/base/api/tabs.json
@@ -1,7 +1,6 @@
{
"props": {
"children": { "type": { "name": "node" } },
- "component": { "type": { "name": "elementType" } },
"defaultValue": { "type": { "name": "union", "description": "number | string" } },
"direction": {
"type": { "name": "enum", "description": "'ltr' | 'rtl'" },
diff --git a/docs/pages/base/api/use-form-control-context.json b/docs/pages/base/api/use-form-control-context.json
index acbb34e0ef36bc..e34be0c419fbd8 100644
--- a/docs/pages/base/api/use-form-control-context.json
+++ b/docs/pages/base/api/use-form-control-context.json
@@ -1,26 +1,27 @@
{
"parameters": {},
"returnValue": {
+ "disabled": { "type": { "name": "boolean", "description": "boolean" }, "required": true },
+ "error": { "type": { "name": "boolean", "description": "boolean" }, "required": true },
"filled": { "type": { "name": "boolean", "description": "boolean" }, "required": true },
"focused": { "type": { "name": "boolean", "description": "boolean" }, "required": true },
"onBlur": {
"type": { "name": "() => void", "description": "() => void" },
"required": true
},
- "onFocus": {
- "type": { "name": "() => void", "description": "() => void" },
- "required": true
- },
- "disabled": { "type": { "name": "boolean", "description": "boolean" }, "default": "false" },
- "error": { "type": { "name": "boolean", "description": "boolean" }, "default": "false" },
"onChange": {
"type": {
"name": "React.ChangeEventHandler<NativeFormControlElement>",
"description": "React.ChangeEventHandler<NativeFormControlElement>"
- }
+ },
+ "required": true
+ },
+ "onFocus": {
+ "type": { "name": "() => void", "description": "() => void" },
+ "required": true
},
- "required": { "type": { "name": "boolean", "description": "boolean" }, "default": "false" },
- "value": { "type": { "name": "unknown", "description": "unknown" } }
+ "required": { "type": { "name": "boolean", "description": "boolean" }, "required": true },
+ "value": { "type": { "name": "unknown", "description": "unknown" }, "required": true }
},
"name": "useFormControlContext",
"filename": "/packages/mui-base/src/FormControl/useFormControlContext.ts",
diff --git a/docs/pages/base/api/use-select.json b/docs/pages/base/api/use-select.json
index c3cfcd10f69cb2..de937ae0b9e90f 100644
--- a/docs/pages/base/api/use-select.json
+++ b/docs/pages/base/api/use-select.json
@@ -11,6 +11,13 @@
}
},
"disabled": { "type": { "name": "boolean", "description": "boolean" }, "default": "false" },
+ "getOptionAsString": {
+ "type": {
+ "name": "(option: SelectOption<OptionValue>) => string",
+ "description": "(option: SelectOption<OptionValue>) => string"
+ },
+ "default": "defaultOptionStringifier"
+ },
"listboxId": { "type": { "name": "string", "description": "string" } },
"listboxRef": {
"type": { "name": "React.Ref<Element>", "description": "React.Ref<Element>" }
@@ -18,14 +25,14 @@
"multiple": { "type": { "name": "Multiple", "description": "Multiple" }, "default": "false" },
"onChange": {
"type": {
- "name": "(e: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null, value: SelectValue<OptionValue, Multiple>) => void",
- "description": "(e: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null, value: SelectValue<OptionValue, Multiple>) => void"
+ "name": "(event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null, value: SelectValue<OptionValue, Multiple>) => void",
+ "description": "(event: React.MouseEvent | React.KeyboardEvent | React.FocusEvent | null, value: SelectValue<OptionValue, Multiple>) => void"
}
},
"onHighlightChange": {
"type": {
- "name": "(e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element> | React.FocusEvent<Element, Element> | null, highlighted: OptionValue | null) => void",
- "description": "(e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element> | React.FocusEvent<Element, Element> | null, highlighted: OptionValue | null) => void"
+ "name": "(event: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element> | React.FocusEvent<Element, Element> | null, highlighted: OptionValue | null) => void",
+ "description": "(event: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element> | React.FocusEvent<Element, Element> | null, highlighted: OptionValue | null) => void"
}
},
"onOpenChange": {
@@ -38,13 +45,6 @@
"description": "SelectOptionDefinition<OptionValue>[]"
}
},
- "optionStringifier": {
- "type": {
- "name": "(option: SelectOption<OptionValue>) => string",
- "description": "(option: SelectOption<OptionValue>) => string"
- },
- "default": "defaultOptionStringifier"
- },
"value": {
"type": {
"name": "SelectValue<OptionValue, Multiple>",
diff --git a/docs/pages/base/getting-started/installation.js b/docs/pages/base/getting-started/quickstart.js
similarity index 63%
rename from docs/pages/base/getting-started/installation.js
rename to docs/pages/base/getting-started/quickstart.js
index 9447440bf3d9f0..db0300dcd11b6e 100644
--- a/docs/pages/base/getting-started/installation.js
+++ b/docs/pages/base/getting-started/quickstart.js
@@ -1,6 +1,6 @@
import * as React from 'react';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
-import * as pageProps from 'docs/data/base/getting-started/installation/installation.md?@mui/markdown';
+import * as pageProps from 'docs/data/base/getting-started/quickstart/quickstart.md?@mui/markdown';
export default function Page() {
return ;
diff --git a/docs/pages/blog/2019.md b/docs/pages/blog/2019.md
index bf2eeafb974136..e12b38477e5234 100644
--- a/docs/pages/blog/2019.md
+++ b/docs/pages/blog/2019.md
@@ -101,5 +101,5 @@ Enterprise features will build on the open source version of the components.
We are looking for a full-time Software Developer to join us!
-If you want to help us onboard more full-time developers in the team, [here are a couple of ways](/material-ui/getting-started/faq/#mui-is-awesome-how-can-i-support-the-project).
+If you want to help us onboard more full-time developers in the team, [here are a couple of ways](/material-ui/getting-started/faq/#mui-is-awesome-how-can-i-support-the-company).
Spreading the word to other developers that are looking for a great UI framework is also extremely helpful š.
diff --git a/docs/pages/blog/2020-q3-update.md b/docs/pages/blog/2020-q3-update.md
index 76327b33a8a564..0503a53fa87aae 100644
--- a/docs/pages/blog/2020-q3-update.md
+++ b/docs/pages/blog/2020-q3-update.md
@@ -118,7 +118,7 @@ Here are the most significant improvements since June 2020. This was a dense qua
Slider powered by styled-components
- āæļø We have kept investing in accessibility, we have fixed [13 bugs](https://github.com/mui/material-ui/pulls?q=is%3Apr+label%3Aaccessibility+is%3Aclosed+sort%3Aupdated-desc).
-- š We have introduced public quarterly roadmaps, both for [MUI Core](https://github.com/mui/material-ui/projects/25) and [MUI X](https://github.com/mui/mui-x/projects/1).
+- š We have introduced public quarterly roadmaps, both for [MUI Core](https://github.com/orgs/mui/projects/18/views/1) and [MUI X](https://github.com/mui/mui-x/projects/1).
## Company
@@ -151,7 +151,7 @@ We'll do our best, no guarantee!
### Community
-- š Execute on all the items of the [public roadmap](https://github.com/mui/material-ui/projects/25).
+- š Execute on all the items of the [public roadmap](https://github.com/orgs/mui/projects/18/views/1).
- š©āšØ Simplify the migration experience from v4 to v5.
- ā Please upvote [GitHub issues](https://github.com/mui/material-ui/issues) if you want us to focus on a specific problem. The number of š helps us to prioritize.
diff --git a/docs/pages/blog/2021-q1-update.md b/docs/pages/blog/2021-q1-update.md
index 5d4ccf344fc530..c51f522f053364 100644
--- a/docs/pages/blog/2021-q1-update.md
+++ b/docs/pages/blog/2021-q1-update.md
@@ -205,7 +205,7 @@ We have the following objectives:
- š Get v5-beta (no more breaking changes) out! The development of this new version started almost a year ago. It's time to aim for the stable release.
- š
Start handling the issues with the date picker reported by developers.
-- š Execute on all the items of the [public roadmap](https://github.com/mui/material-ui/projects/25).
+- š Execute on all the items of the [public roadmap](https://github.com/orgs/mui/projects/18/views/1).
- ā Please upvote [GitHub issues](https://github.com/mui/material-ui/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) if you want us to focus on a specific problem. The number of š helps us to prioritize.
### Advanced components
diff --git a/docs/pages/blog/2021-q2-update.md b/docs/pages/blog/2021-q2-update.md
index 29cb68202c1157..0e468a63b5cbcf 100644
--- a/docs/pages/blog/2021-q2-update.md
+++ b/docs/pages/blog/2021-q2-update.md
@@ -220,7 +220,7 @@ We have the following objectives:
You can follow our progress in the [umbrella issue](https://github.com/mui/material-ui/issues/27170).
- š Do a proof of concept on supporting a second design system.
Some of our users (and potential users) dislike Material Design. We will try to make the second design system one that they love!
-- š Execute on all of the items in the [public roadmap](https://github.com/mui/material-ui/projects/25).
+- š Execute on all of the items in the [public roadmap](https://github.com/orgs/mui/projects/18/views/1).
- ā Please upvote [GitHub issues](https://github.com/mui/material-ui/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) if you want us to focus on a specific problem. The number of š helps us to prioritize.
### Advanced components
diff --git a/docs/pages/blog/2021-q3-update.md b/docs/pages/blog/2021-q3-update.md
index 5c310c102e8cd5..994b5b0ac32a6b 100644
--- a/docs/pages/blog/2021-q3-update.md
+++ b/docs/pages/blog/2021-q3-update.md
@@ -200,7 +200,7 @@ We'll do our best, no guarantee!
Since v5, MUI is no longer actively supporting IE 11. Dropping this browser requirement unlocks new capabilities of the web platform.
- š Resume work on the second design system.
Some users (and potential users) dislike Material Design. We'll try to make the second design system one that they love! You can check our [first RFC](https://github.com/mui/material-ui/discussions/29024).
-- š Execute on all of the items in the [public roadmap](https://github.com/mui/material-ui/projects/25).
+- š Execute on all of the items in the [public roadmap](https://github.com/orgs/mui/projects/18/views/1).
- ā Please upvote [GitHub issues](https://github.com/mui/material-ui/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) if you want us to focus on a specific problem. The number of š helps us to prioritize.
### MUI X
diff --git a/docs/pages/blog/benny-joo-joining.md b/docs/pages/blog/benny-joo-joining.md
index 2391da49933f83..98695585680458 100644
--- a/docs/pages/blog/benny-joo-joining.md
+++ b/docs/pages/blog/benny-joo-joining.md
@@ -16,6 +16,6 @@ He had a great start with his internship, implementing the [Masonry component](h
As part of the Core team, he will help with the community support, as well as work on some of the new features we plan for the community version of the library, like the unstyled components and the second design system.
I am excited to see what other valuable contributions he will make in the future.
-The Core team will continue developing the foundations on which to build great design systems. Here's a quick view of [the community roadmap](https://github.com/mui/material-ui/projects/25).
+The Core team will continue developing the foundations on which to build great design systems. Here's a quick view of [the community roadmap](https://github.com/orgs/mui/projects/18/views/1).
We couldn't be more excited to have Benny on the team!
diff --git a/docs/pages/blog/marija-najdova-joining.md b/docs/pages/blog/marija-najdova-joining.md
index 6e858e74d21f73..596924c97fa3bc 100644
--- a/docs/pages/blog/marija-najdova-joining.md
+++ b/docs/pages/blog/marija-najdova-joining.md
@@ -15,6 +15,6 @@ Marija is off to a running start, having made important changes happen during he
She is now actively working on the unstyled components and [the update of the style engine](https://github.com/mui/material-ui/issues/22342). These are two items we've been eager to push forward since the release of v1 but that required someone to be dedicated to tackling them.
-The community team will continue developing the foundations on which to build great design systems. Here's a quick view of [the community roadmap](https://github.com/mui/material-ui/projects/25).
+The community team will continue developing the foundations on which to build great design systems. Here's a quick view of [the community roadmap](https://github.com/orgs/mui/projects/18/views/1).
We couldn't be more excited to have Marija on the team! You can follow her on [Twitter](https://twitter.com/marijanajdova).
diff --git a/docs/pages/careers/senior-designer.js b/docs/pages/careers/senior-designer.js
deleted file mode 100644
index bcc36340350858..00000000000000
--- a/docs/pages/careers/senior-designer.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import * as React from 'react';
-import TopLayoutCareers from 'docs/src/modules/components/TopLayoutCareers';
-import * as pageProps from 'docs/src/pages/careers/senior-designer.md?@mui/markdown';
-
-export default function Page() {
- return ;
-}
diff --git a/docs/pages/material-ui/api/input.json b/docs/pages/material-ui/api/input.json
index 023edaf5d786b1..319f57dcdcb0fe 100644
--- a/docs/pages/material-ui/api/input.json
+++ b/docs/pages/material-ui/api/input.json
@@ -71,6 +71,8 @@
"input",
"inputSizeSmall",
"inputMultiline",
+ "inputAdornedStart",
+ "inputAdornedEnd",
"inputTypeSearch"
],
"globalClasses": { "focused": "Mui-focused", "disabled": "Mui-disabled", "error": "Mui-error" },
diff --git a/docs/pages/material-ui/api/popper.json b/docs/pages/material-ui/api/popper.json
index 37022ca054859a..36b3a8fa00dab3 100644
--- a/docs/pages/material-ui/api/popper.json
+++ b/docs/pages/material-ui/api/popper.json
@@ -8,6 +8,7 @@
}
},
"children": { "type": { "name": "union", "description": "node | func" } },
+ "component": { "type": { "name": "elementType" } },
"components": {
"type": { "name": "shape", "description": "{ Root?: elementType }" },
"default": "{}"
diff --git a/docs/public/static/branding/about/romain.png b/docs/public/static/branding/about/romain.png
new file mode 100644
index 00000000000000..a1e7728e9272d2
Binary files /dev/null and b/docs/public/static/branding/about/romain.png differ
diff --git a/docs/public/static/images/showcase/dropdesk.jpg b/docs/public/static/images/showcase/dropdesk.jpg
deleted file mode 100644
index a93a1191629d16..00000000000000
Binary files a/docs/public/static/images/showcase/dropdesk.jpg and /dev/null differ
diff --git a/docs/public/static/images/showcase/openclassrooms.jpg b/docs/public/static/images/showcase/openclassrooms.jpg
deleted file mode 100644
index 48eb8036bd2b3f..00000000000000
Binary files a/docs/public/static/images/showcase/openclassrooms.jpg and /dev/null differ
diff --git a/docs/public/static/images/showcase/openclassrooms.png b/docs/public/static/images/showcase/openclassrooms.png
new file mode 100644
index 00000000000000..1d223f8cabacb3
Binary files /dev/null and b/docs/public/static/images/showcase/openclassrooms.png differ
diff --git a/docs/public/static/images/showcase/quintoandar.jpg b/docs/public/static/images/showcase/quintoandar.jpg
new file mode 100644
index 00000000000000..0b65fd70af6ab9
Binary files /dev/null and b/docs/public/static/images/showcase/quintoandar.jpg differ
diff --git a/docs/public/static/images/showcase/quintoandar.png b/docs/public/static/images/showcase/quintoandar.png
deleted file mode 100644
index 7d3cde221f088c..00000000000000
Binary files a/docs/public/static/images/showcase/quintoandar.png and /dev/null differ
diff --git a/docs/scripts/formattedTSDemos.js b/docs/scripts/formattedTSDemos.js
index cdce47d9fa36b1..eb1d5ef79267a6 100644
--- a/docs/scripts/formattedTSDemos.js
+++ b/docs/scripts/formattedTSDemos.js
@@ -9,7 +9,11 @@
* List of demos or folders to ignore when transpiling
* Example: "app-bar/BottomAppBar.tsx"
*/
-const ignoreList = ['/pages.ts', 'docs/data/joy/getting-started/templates'];
+const ignoreList = [
+ '/pages.ts',
+ 'docs/data/joy/getting-started/templates',
+ 'docs/data/base/components/select/UnstyledSelectIntroduction.tsx',
+];
const fse = require('fs-extra');
const path = require('path');
@@ -27,6 +31,7 @@ const babelConfig = {
generatorOpts: { retainLines: true },
babelrc: false,
configFile: false,
+ shouldPrintComment: (comment) => !comment.startsWith(' @babel-ignore-comment-in-output'),
};
const workspaceRoot = path.join(__dirname, '../../');
diff --git a/docs/src/components/header/HeaderNavBar.tsx b/docs/src/components/header/HeaderNavBar.tsx
index c136fa434eb8bc..fccd9fb634faa0 100644
--- a/docs/src/components/header/HeaderNavBar.tsx
+++ b/docs/src/components/header/HeaderNavBar.tsx
@@ -369,7 +369,9 @@ export default function HeaderNavBar() {
href={ROUTES.productToolpad}
icon={ }
name="MUI Toolpad"
- chip={ }
+ chip={
+
+ }
description="Low-code admin builder."
onKeyDown={handleKeyDown}
/>
diff --git a/docs/src/components/header/HeaderNavDropdown.tsx b/docs/src/components/header/HeaderNavDropdown.tsx
index c2fd0eaeb03e51..637165e365fac9 100644
--- a/docs/src/components/header/HeaderNavDropdown.tsx
+++ b/docs/src/components/header/HeaderNavDropdown.tsx
@@ -224,7 +224,12 @@ export default function HeaderNavDropdown() {
>
{item.name}
{item.chip ? (
-
+
) : null}
@@ -270,7 +275,12 @@ export default function HeaderNavDropdown() {
>
{item.name}
{item.chip ? (
-
+
) : null}
diff --git a/docs/src/components/productX/XDateRangeDemo.tsx b/docs/src/components/productX/XDateRangeDemo.tsx
index a9ced17144be4f..2ae8d2a49d1400 100644
--- a/docs/src/components/productX/XDateRangeDemo.tsx
+++ b/docs/src/components/productX/XDateRangeDemo.tsx
@@ -170,7 +170,7 @@ export default function XDateRangeDemo() {
diff --git a/docs/src/createEmotionCache.ts b/docs/src/createEmotionCache.ts
index 4ec97e97eafed3..a0c402f8b187b6 100644
--- a/docs/src/createEmotionCache.ts
+++ b/docs/src/createEmotionCache.ts
@@ -8,8 +8,8 @@ function globalSelector(element: Element) {
switch (element.type) {
case RULESET:
element.props = (element.props as string[]).map((value: any) => {
- if (value.match(/(:where|:has)\(/)) {
- value = value.replace(/\.[^:]+(:where|:has)/, '$1');
+ if (value.match(/(:where|:is)\(/)) {
+ value = value.replace(/\.[^:]+(:where|:is)/, '$1');
return value;
}
return value;
diff --git a/docs/src/featureToggle.js b/docs/src/featureToggle.js
index fd4be22569cc03..d181b032765b3a 100644
--- a/docs/src/featureToggle.js
+++ b/docs/src/featureToggle.js
@@ -3,4 +3,5 @@ module.exports = {
enable_website_banner: false,
enable_toc_banner: true,
enable_docsnav_banner: true,
+ enable_job_banner: false,
};
diff --git a/docs/src/modules/brandingTheme.ts b/docs/src/modules/brandingTheme.ts
index a84576a5f47e16..2c4cdafe26ec2e 100644
--- a/docs/src/modules/brandingTheme.ts
+++ b/docs/src/modules/brandingTheme.ts
@@ -305,7 +305,7 @@ export const getDesignTokens = (mode: 'light' | 'dark') =>
fontWeight: 700,
},
allVariants: {
- scrollMarginTop: 'calc(var(--MuiDocs-header-height) + 72px)',
+ scrollMarginTop: 'calc(var(--MuiDocs-header-height) + 32px)',
},
},
/**
diff --git a/docs/src/modules/components/AppContainer.js b/docs/src/modules/components/AppContainer.js
index c876378bf37f0c..43d8cc40231b61 100644
--- a/docs/src/modules/components/AppContainer.js
+++ b/docs/src/modules/components/AppContainer.js
@@ -4,7 +4,7 @@ import Container from '@mui/material/Container';
const StyledAppContainer = styled(Container)(({ theme }) => {
return {
- paddingTop: 'calc(var(--MuiDocs-header-height) + 36px)',
+ paddingTop: `calc(var(--MuiDocs-header-height) + ${theme.spacing(4)})`,
// We're mostly hosting text content so max-width by px does not make sense considering font-size is system-adjustable.
// 105ch ā 930px
fontFamily: 'Arial',
diff --git a/docs/src/modules/components/AppFrame.js b/docs/src/modules/components/AppFrame.js
index 9069134d2fd9b4..07ae00877bfb6e 100644
--- a/docs/src/modules/components/AppFrame.js
+++ b/docs/src/modules/components/AppFrame.js
@@ -154,6 +154,8 @@ const StyledAppNavDrawer = styled(AppNavDrawer)(({ disablePermanent, theme }) =>
};
});
+export const HEIGHT = 64;
+
export default function AppFrame(props) {
const { children, disableDrawer = false, className, BannerComponent = AppFrameBanner } = props;
const t = useTranslate();
@@ -175,7 +177,7 @@ export default function AppFrame(props) {
diff --git a/docs/src/modules/components/AppLayoutDocs.js b/docs/src/modules/components/AppLayoutDocs.js
index d069da3046aa27..f6b14cc51a529c 100644
--- a/docs/src/modules/components/AppLayoutDocs.js
+++ b/docs/src/modules/components/AppLayoutDocs.js
@@ -50,15 +50,15 @@ const StyledAppContainer = styled(AppContainer, {
marginBottom: 198,
},
'&& .description.ad': {
- marginBottom: 40,
+ marginBottom: 0,
},
}),
...(hasTabs && {
'&& .component-tabs .MuiTabs-root': {
- marginBottom: 193,
+ marginBottom: 198,
},
'&& .component-tabs.ad .MuiTabs-root': {
- marginBottom: 35,
+ marginBottom: 0,
},
}),
}),
@@ -86,10 +86,10 @@ function AppLayoutDocs(props) {
description,
disableAd = false,
disableToc = false,
+ hasTabs = false,
location,
title,
toc,
- hasTabs = false,
} = props;
if (description === undefined) {
diff --git a/docs/src/modules/components/AppLayoutDocsWithoutAppFrame.js b/docs/src/modules/components/AppLayoutDocsWithoutAppFrame.js
index c75c597ab3efef..c9777a4ac97c49 100644
--- a/docs/src/modules/components/AppLayoutDocsWithoutAppFrame.js
+++ b/docs/src/modules/components/AppLayoutDocsWithoutAppFrame.js
@@ -49,15 +49,15 @@ const StyledAppContainer = styled(AppContainer, {
marginBottom: 198,
},
'&& .description.ad': {
- marginBottom: 40,
+ marginBottom: 0,
},
}),
...(hasTabs && {
'&& .component-tabs .MuiTabs-root': {
- marginBottom: 193,
+ marginBottom: 198,
},
'&& .component-tabs.ad .MuiTabs-root': {
- marginBottom: 35,
+ marginBottom: 0,
},
}),
}),
@@ -84,10 +84,10 @@ function AppLayoutDocs(props) {
description,
disableAd = false,
disableToc = false,
+ hasTabs = false,
location,
title,
toc,
- hasTabs = false,
} = props;
if (description === undefined) {
diff --git a/docs/src/modules/components/AppTableOfContents.js b/docs/src/modules/components/AppTableOfContents.js
index cee602915b6495..21967320bbdf0b 100644
--- a/docs/src/modules/components/AppTableOfContents.js
+++ b/docs/src/modules/components/AppTableOfContents.js
@@ -9,6 +9,7 @@ import Link from 'docs/src/modules/components/Link';
import { useTranslate } from 'docs/src/modules/utils/i18n';
import { shouldHandleLinkClick } from 'docs/src/modules/components/MarkdownLinks';
import TableOfContentsBanner from 'docs/src/components/banner/TableOfContentsBanner';
+import featureToggle from 'docs/src/featureToggle';
const Nav = styled('nav')(({ theme }) => ({
top: 0,
@@ -16,7 +17,7 @@ const Nav = styled('nav')(({ theme }) => ({
position: 'sticky',
height: '100vh',
overflowY: 'auto',
- paddingTop: 'calc(var(--MuiDocs-header-height) + 1rem)',
+ paddingTop: `calc(var(--MuiDocs-header-height) + ${theme.spacing(4)})`,
paddingBottom: theme.spacing(4),
paddingRight: theme.spacing(4), // We can't use `padding` as stylis-plugin-rtl doesn't swap it
display: 'none',
@@ -131,7 +132,7 @@ function flatten(headings) {
return itemsWithNode;
}
-const shouldShowJobAd = () => {
+function shouldShowJobAd() {
const date = new Date();
const timeZoneOffset = date.getTimezoneOffset();
// Hide for time zones UT+5.5 - UTC+14 & UTC-8 - UTC-12
@@ -139,13 +140,14 @@ const shouldShowJobAd = () => {
return false;
}
return true;
-};
+}
+
+const showSurveyBanner = false;
+const showJobAd = featureToggle.enable_job_banner && shouldShowJobAd();
export default function AppTableOfContents(props) {
const { toc } = props;
const t = useTranslate();
- const showSurveyBanner = false;
- const showAddJob = shouldShowJobAd() && !showSurveyBanner;
const items = React.useMemo(() => flatten(toc), [toc]);
const [activeState, setActiveState] = React.useState(null);
@@ -280,7 +282,7 @@ export default function AppTableOfContents(props) {
)}
- {showAddJob && (
+ {!showSurveyBanner && showJobAd && (
{
- window.scrollTo({ top: 0 });
+ const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
+ const behavior = prefersReducedMotion.matches ? 'auto' : 'smooth';
+
+ window.scrollTo({ top: 0, behavior });
setOpen(false);
};
diff --git a/docs/src/modules/components/ComponentPageTabs.js b/docs/src/modules/components/ComponentPageTabs.js
index 9953606c50ffc1..e1a864c84c6003 100644
--- a/docs/src/modules/components/ComponentPageTabs.js
+++ b/docs/src/modules/components/ComponentPageTabs.js
@@ -7,6 +7,8 @@ import Tabs, { tabsClasses } from '@mui/material/Tabs';
import Tab, { tabClasses } from '@mui/material/Tab';
import Link from 'docs/src/modules/components/Link';
+export const HEIGHT = 50;
+
export default function ComponentPageTabs(props) {
const {
activeTab,
diff --git a/docs/src/modules/components/EditPage.js b/docs/src/modules/components/EditPage.js
index 9060cc1818fd49..c6085b3e5d3630 100644
--- a/docs/src/modules/components/EditPage.js
+++ b/docs/src/modules/components/EditPage.js
@@ -2,7 +2,7 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import Button from '@mui/material/Button';
import { useUserLanguage, useTranslate } from 'docs/src/modules/utils/i18n';
-import EditRoundedIcon from '@mui/icons-material/EditRounded';
+import GitHubIcon from '@mui/icons-material/GitHub';
export default function EditPage(props) {
const { markdownLocation } = props;
@@ -27,7 +27,7 @@ export default function EditPage(props) {
target="_blank"
rel="noopener nofollow"
size="small"
- startIcon={ }
+ startIcon={ }
data-ga-event-category={userLanguage === 'en' ? undefined : 'l10n'}
data-ga-event-action={userLanguage === 'en' ? undefined : 'edit-button'}
data-ga-event-label={userLanguage === 'en' ? undefined : userLanguage}
diff --git a/docs/src/modules/components/MarkdownDocsV2.js b/docs/src/modules/components/MarkdownDocsV2.js
index c95bd6896f3b24..2425c041c566b3 100644
--- a/docs/src/modules/components/MarkdownDocsV2.js
+++ b/docs/src/modules/components/MarkdownDocsV2.js
@@ -4,7 +4,6 @@ import { useRouter } from 'next/router';
import kebabCase from 'lodash/kebabCase';
import { useTheme } from '@mui/system';
import { exactProp } from '@mui/utils';
-import Box from '@mui/material/Box';
import { CssVarsProvider, useColorScheme } from '@mui/joy/styles';
import ComponentsApiContent from 'docs/src/modules/components/ComponentsApiContent';
import HooksApiContent from 'docs/src/modules/components/HooksApiContent';
@@ -15,6 +14,8 @@ import AppLayoutDocs from 'docs/src/modules/components/AppLayoutDocsWithoutAppFr
import { useTranslate, useUserLanguage } from 'docs/src/modules/utils/i18n';
import BrandingProvider from 'docs/src/BrandingProvider';
import Ad from 'docs/src/modules/components/Ad';
+import { HEIGHT as AppFrameHeight } from 'docs/src/modules/components/AppFrame';
+import { HEIGHT as TabsHeight } from 'docs/src/modules/components/ComponentPageTabs';
import AdGuest from 'docs/src/modules/components/AdGuest';
function JoyModeObserver({ mode }) {
@@ -219,54 +220,55 @@ export default function MarkdownDocsV2(props) {
toc={activeToc}
hasTabs
>
-
- {isJoy && }
- {disableAd ? null : (
-
-
-
-
-
- )}
- {commonElements}
- {activeTab === '' && (
-
- {rendered.slice(i, rendered.length - 1).map((renderedMarkdownOrDemo, index) => (
-
- ))}
-
- )}
- {activeTab === 'components-api' && (
-
+
+
+ {isJoy && }
+ {disableAd ? null : (
+
+
+
+
+
+ )}
+ {commonElements}
+ {activeTab === '' &&
+ rendered
+ .slice(i, rendered.length - 1)
+ .map((renderedMarkdownOrDemo, index) => (
+
+ ))}
+ {activeTab === 'components-api' && (
-
- )}
- {activeTab === 'hooks-api' && (
-
+ )}
+ {activeTab === 'hooks-api' && (
-
- )}
-
+ )}
+
+
);
}
diff --git a/docs/src/modules/components/MarkdownElement.js b/docs/src/modules/components/MarkdownElement.js
index b9aeaac64fbcf8..0aa77f7d6583b6 100644
--- a/docs/src/modules/components/MarkdownElement.js
+++ b/docs/src/modules/components/MarkdownElement.js
@@ -111,6 +111,8 @@ const Root = styled('div')(
},
'& h1, & h2, & h3, & h4': {
position: 'relative',
+ // Reserve space for the end of the line action button
+ paddingRight: 26 * 2 + 10,
'& code': {
fontSize: 'inherit',
lineHeight: 'inherit',
diff --git a/docs/src/modules/components/MuiProductSelector.tsx b/docs/src/modules/components/MuiProductSelector.tsx
index 204ec4ba6e44e0..a86c8195ef635e 100644
--- a/docs/src/modules/components/MuiProductSelector.tsx
+++ b/docs/src/modules/components/MuiProductSelector.tsx
@@ -198,7 +198,7 @@ export default function MuiProductSelector() {
icon={ }
name="MUI Toolpad"
description="Low-code admin builder."
- chip={ }
+ chip={ }
/>
diff --git a/docs/src/pages.ts b/docs/src/pages.ts
index c76ae6e932eaa0..11aaaf84787142 100644
--- a/docs/src/pages.ts
+++ b/docs/src/pages.ts
@@ -164,7 +164,7 @@ const pages: readonly MuiPage[] = [
],
},
{
- title: 'Component API',
+ title: 'APIs',
pathname: '/api-docs',
icon: standardNavIcons.CodeIcon,
children: [
@@ -288,7 +288,7 @@ const pages: readonly MuiPage[] = [
children: [
{ pathname: '/styles/basics' },
{ pathname: '/styles/advanced' },
- { pathname: '/styles/api', title: 'API' },
+ { pathname: '/styles/api', title: 'APIs' },
],
},
{
diff --git a/docs/translations/api-docs-base/badge/badge.json b/docs/translations/api-docs-base/badge/badge.json
index 677e829f386373..7b35413dae7ceb 100644
--- a/docs/translations/api-docs-base/badge/badge.json
+++ b/docs/translations/api-docs-base/badge/badge.json
@@ -3,7 +3,6 @@
"propDescriptions": {
"badgeContent": "The content rendered within the badge.",
"children": "The badge will be added relative to this node.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"invisible": "If true
, the badge is invisible.",
"max": "Max count to show.",
"showZero": "Controls whether the badge is hidden when badgeContent
is zero.",
diff --git a/docs/translations/api-docs-base/form-control/form-control.json b/docs/translations/api-docs-base/form-control/form-control.json
index 1af947ce5c1f86..639969fc0126a0 100644
--- a/docs/translations/api-docs-base/form-control/form-control.json
+++ b/docs/translations/api-docs-base/form-control/form-control.json
@@ -2,7 +2,6 @@
"componentDescription": "Provides context such as filled/focused/error/required for form inputs.\nRelying on the context provides high flexibility and ensures that the state always stays\nconsistent across the children of the `FormControl`.\nThis context is used by the following components:\n\n* FormLabel\n* FormHelperText\n* Input\n* InputLabel\n\nYou can find one composition example below and more going to [the demos](https://mui.com/material-ui/react-text-field/#components).\n\n```jsx\n\n Email address \n \n We'll never share your email. \n \n```\n\nā ļø Only one `Input` can be used within a FormControl because it create visual inconsistencies.\nFor instance, only one input can be focused at the same time, the state shouldn't be shared.",
"propDescriptions": {
"children": "The content of the component.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"disabled": "If true
, the label, input and helper text should be displayed in a disabled state.",
"error": "If true
, the label is displayed in an error state.",
"onChange": "Callback fired when the form element's value is modified.",
diff --git a/docs/translations/api-docs-base/input/input.json b/docs/translations/api-docs-base/input/input.json
index 2853be93336b60..604e11cb95e78e 100644
--- a/docs/translations/api-docs-base/input/input.json
+++ b/docs/translations/api-docs-base/input/input.json
@@ -4,7 +4,6 @@
"autoComplete": "This prop helps users to fill forms faster, especially on mobile devices. The name can be confusing, as it's more like an autofill. You can learn more about it following the specification .",
"autoFocus": "If true
, the input
element is focused during the first mount.",
"className": "Class name applied to the root element.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"defaultValue": "The default value. Use when the component is not controlled.",
"disabled": "If true
, the component is disabled. The prop defaults to the value (false
) inherited from the parent FormControl component.",
"endAdornment": "Trailing adornment for this input.",
diff --git a/docs/translations/api-docs-base/menu-item/menu-item.json b/docs/translations/api-docs-base/menu-item/menu-item.json
index 1d5601b2a7adfa..4582dbc3a635eb 100644
--- a/docs/translations/api-docs-base/menu-item/menu-item.json
+++ b/docs/translations/api-docs-base/menu-item/menu-item.json
@@ -1,7 +1,6 @@
{
"componentDescription": "",
"propDescriptions": {
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"label": "A text representation of the menu item's content. Used for keyboard text navigation matching.",
"slotProps": "The props used for each slot inside the MenuItem.",
"slots": "The components used for each slot inside the MenuItem. Either a string to use a HTML element or a component. See Slots API below for more details."
diff --git a/docs/translations/api-docs-base/menu/menu.json b/docs/translations/api-docs-base/menu/menu.json
index da3220db4b7701..3c132b59c33c47 100644
--- a/docs/translations/api-docs-base/menu/menu.json
+++ b/docs/translations/api-docs-base/menu/menu.json
@@ -3,7 +3,6 @@
"propDescriptions": {
"actions": "A ref with imperative actions. It allows to select the first or last menu item.",
"anchorEl": "An HTML element, virtualElement , or a function that returns either. It's used to set the position of the popper.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"onOpenChange": "Triggered when focus leaves the menu and the menu should close.",
"open": "Controls whether the menu is displayed.",
"slotProps": "The props used for each slot inside the Menu.",
diff --git a/docs/translations/api-docs-base/modal/modal.json b/docs/translations/api-docs-base/modal/modal.json
index 83c5cf84ab30ec..0ce4a100e2ce69 100644
--- a/docs/translations/api-docs-base/modal/modal.json
+++ b/docs/translations/api-docs-base/modal/modal.json
@@ -3,7 +3,6 @@
"propDescriptions": {
"children": "A single child content element. ā ļø Needs to be able to hold a ref .",
"closeAfterTransition": "When set to true the Modal waits until a nested Transition is completed before closing.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"container": "An HTML element or function that returns one. The container
will have the portal children appended to it. By default, it uses the body of the top-level document object, so it's simply document.body
most of the time.",
"disableAutoFocus": "If true
, the modal will not automatically shift focus to itself when it opens, and replace it to the last focused element when it closes. This also works correctly with any modal children that have the disableAutoFocus
prop. Generally this should never be set to true
as it makes the modal less accessible to assistive technologies, like screen readers.",
"disableEnforceFocus": "If true
, the modal will not prevent focus from leaving the modal while open. Generally this should never be set to true
as it makes the modal less accessible to assistive technologies, like screen readers.",
diff --git a/docs/translations/api-docs-base/option-group/option-group.json b/docs/translations/api-docs-base/option-group/option-group.json
index a6f2a32d74ed40..2914c0a842eccd 100644
--- a/docs/translations/api-docs-base/option-group/option-group.json
+++ b/docs/translations/api-docs-base/option-group/option-group.json
@@ -1,7 +1,6 @@
{
"componentDescription": "An unstyled option group to be used within a Select.",
"propDescriptions": {
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"disabled": "If true
all the options in the group will be disabled.",
"label": "The human-readable description of the group.",
"slotProps": "The props used for each slot inside the Input.",
diff --git a/docs/translations/api-docs-base/option/option.json b/docs/translations/api-docs-base/option/option.json
index 9242960c42375e..934b7f4c1c0387 100644
--- a/docs/translations/api-docs-base/option/option.json
+++ b/docs/translations/api-docs-base/option/option.json
@@ -1,7 +1,6 @@
{
"componentDescription": "An unstyled option to be used within a Select.",
"propDescriptions": {
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"disabled": "If true
, the option will be disabled.",
"label": "A text representation of the option's content. Used for keyboard text navigation matching.",
"slotProps": "The props used for each slot inside the Option.",
diff --git a/docs/translations/api-docs-base/select/select.json b/docs/translations/api-docs-base/select/select.json
index 590bbb9533d5fc..6e6f0502e5cfb4 100644
--- a/docs/translations/api-docs-base/select/select.json
+++ b/docs/translations/api-docs-base/select/select.json
@@ -2,10 +2,10 @@
"componentDescription": "The foundation for building custom-styled select components.",
"propDescriptions": {
"autoFocus": "If true
, the select element is focused during the first mount",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"defaultListboxOpen": "If true
, the select will be initially open.",
"defaultValue": "The default selected value. Use when the component is not controlled.",
"disabled": "If true
, the select is disabled.",
+ "getOptionAsString": "A function used to convert the option label to a string. It's useful when labels are elements and need to be converted to plain text to enable navigation using character keys on a keyboard.",
"getSerializedValue": "A function to convert the currently selected value to a string. Used to set a value of a hidden input associated with the select, so that the selected value can be posted with a form.",
"listboxId": "id
attribute of the listbox element.",
"listboxOpen": "Controls the open state of the select's listbox.",
@@ -13,7 +13,6 @@
"name": "Name of the element. For example used by the server to identify the fields in form submits. If the name is provided, the component will render a hidden input element that can be submitted to a server.",
"onChange": "Callback fired when an option is selected.",
"onListboxOpenChange": "Callback fired when the component requests to be opened. Use in controlled mode (see listboxOpen).",
- "optionStringifier": "A function used to convert the option label to a string. It's useful when labels are elements and need to be converted to plain text to enable navigation using character keys on a keyboard.",
"renderValue": "Function that customizes the rendering of the selected value.",
"slotProps": "The props used for each slot inside the Input.",
"slots": "The components used for each slot inside the Select. Either a string to use a HTML element or a component. See Slots API below for more details.",
diff --git a/docs/translations/api-docs-base/slider/slider.json b/docs/translations/api-docs-base/slider/slider.json
index 3a12486a363953..0feee17949c0d9 100644
--- a/docs/translations/api-docs-base/slider/slider.json
+++ b/docs/translations/api-docs-base/slider/slider.json
@@ -4,7 +4,6 @@
"aria-label": "The label of the slider.",
"aria-labelledby": "The id of the element containing a label for the slider.",
"aria-valuetext": "A string value that provides a user-friendly name for the current value of the slider.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"defaultValue": "The default value. Use when the component is not controlled.",
"disabled": "If true
, the component is disabled.",
"disableSwap": "If true
, the active thumb doesn't swap when moving pointer over a thumb while dragging another thumb.",
diff --git a/docs/translations/api-docs-base/snackbar/snackbar.json b/docs/translations/api-docs-base/snackbar/snackbar.json
index 6c4f7ffd1ef1fd..256e9ea68748c1 100644
--- a/docs/translations/api-docs-base/snackbar/snackbar.json
+++ b/docs/translations/api-docs-base/snackbar/snackbar.json
@@ -2,7 +2,6 @@
"componentDescription": "",
"propDescriptions": {
"autoHideDuration": "The number of milliseconds to wait before automatically calling the onClose
function. onClose
should then set the state of the open
prop to hide the Snackbar. This behavior is disabled by default with the null
value.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"disableWindowBlurListener": "If true
, the autoHideDuration
timer will expire even if the window is not focused.",
"exited": "The prop used to handle exited transition and unmount the component.",
"onClose": "Callback fired when the component requests to be closed. Typically onClose
is used to set state in the parent component, which is used to control the Snackbar
open
prop. The reason
parameter can optionally be used to control the response to onClose
, for example ignoring clickaway
.Signature: function(event: React.SyntheticEvent<any> | Event, reason: string) => void
event: The event source of the callback.reason: Can be: "timeout"
(autoHideDuration
expired), "clickaway"
, or "escapeKeyDown"
.",
diff --git a/docs/translations/api-docs-base/switch/switch.json b/docs/translations/api-docs-base/switch/switch.json
index c51aac68be0678..6b8dc299327fc0 100644
--- a/docs/translations/api-docs-base/switch/switch.json
+++ b/docs/translations/api-docs-base/switch/switch.json
@@ -2,7 +2,6 @@
"componentDescription": "The foundation for building custom-styled switches.",
"propDescriptions": {
"checked": "If true
, the component is checked.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"defaultChecked": "The default checked state. Use when the component is not controlled.",
"disabled": "If true
, the component is disabled.",
"onChange": "Callback fired when the state is changed.Signature: function(event: React.ChangeEvent<HTMLInputElement>) => void
event: The event source of the callback. You can pull out the new value by accessing event.target.value
(string). You can pull out the new checked state by accessing event.target.checked
(boolean).",
diff --git a/docs/translations/api-docs-base/tab-panel/tab-panel.json b/docs/translations/api-docs-base/tab-panel/tab-panel.json
index fa22ca26bbdc73..e3a53028925fc9 100644
--- a/docs/translations/api-docs-base/tab-panel/tab-panel.json
+++ b/docs/translations/api-docs-base/tab-panel/tab-panel.json
@@ -2,7 +2,6 @@
"componentDescription": "",
"propDescriptions": {
"children": "The content of the component.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"slotProps": "The props used for each slot inside the TabPanel.",
"slots": "The components used for each slot inside the TabPanel. Either a string to use a HTML element or a component. See Slots API below for more details.",
"value": "The value of the TabPanel. It will be shown when the Tab with the corresponding value is selected. If not provided, it will fall back to the index of the panel. It is recommended to explicitly provide it, as it's required for the tab panel to be rendered on the server."
diff --git a/docs/translations/api-docs-base/tab/tab.json b/docs/translations/api-docs-base/tab/tab.json
index a022f725a44992..6b1f4d81a06a29 100644
--- a/docs/translations/api-docs-base/tab/tab.json
+++ b/docs/translations/api-docs-base/tab/tab.json
@@ -2,7 +2,6 @@
"componentDescription": "",
"propDescriptions": {
"action": "A ref for imperative actions. It currently only supports focusVisible()
action.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"disabled": "If true
, the component is disabled.",
"onChange": "Callback invoked when new value is being set.",
"slotProps": "The props used for each slot inside the Tab.",
diff --git a/docs/translations/api-docs-base/table-pagination/table-pagination.json b/docs/translations/api-docs-base/table-pagination/table-pagination.json
index 106432ab9dccd0..2c1a32a8a168cf 100644
--- a/docs/translations/api-docs-base/table-pagination/table-pagination.json
+++ b/docs/translations/api-docs-base/table-pagination/table-pagination.json
@@ -1,7 +1,6 @@
{
"componentDescription": "A pagination for tables.",
"propDescriptions": {
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"count": "The total number of rows. To enable server side pagination for an unknown number of items, provide -1.",
"getItemAriaLabel": "Accepts a function which returns a string value that provides a user-friendly name for the current page. This is important for screen reader users. For localization purposes, you can use the provided translations .Signature: function(type: string) => string
type: The link or button type to format ('first' | 'last' | 'next' | 'previous').",
"labelDisplayedRows": "Customize the displayed rows label. Invoked with a { from, to, count, page }
object. For localization purposes, you can use the provided translations .",
diff --git a/docs/translations/api-docs-base/tabs-list/tabs-list.json b/docs/translations/api-docs-base/tabs-list/tabs-list.json
index 0067df3d304aa5..9d459303149ef5 100644
--- a/docs/translations/api-docs-base/tabs-list/tabs-list.json
+++ b/docs/translations/api-docs-base/tabs-list/tabs-list.json
@@ -2,7 +2,6 @@
"componentDescription": "",
"propDescriptions": {
"children": "The content of the component.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"slotProps": "The props used for each slot inside the TabsList.",
"slots": "The components used for each slot inside the TabsList. Either a string to use a HTML element or a component. See Slots API below for more details."
},
diff --git a/docs/translations/api-docs-base/tabs/tabs.json b/docs/translations/api-docs-base/tabs/tabs.json
index fe065328796929..37fa6685b070b8 100644
--- a/docs/translations/api-docs-base/tabs/tabs.json
+++ b/docs/translations/api-docs-base/tabs/tabs.json
@@ -2,7 +2,6 @@
"componentDescription": "",
"propDescriptions": {
"children": "The content of the component.",
- "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"defaultValue": "The default value. Use when the component is not controlled.",
"direction": "The direction of the text.",
"onChange": "Callback invoked when new value is being set.",
diff --git a/docs/translations/api-docs/input/input.json b/docs/translations/api-docs/input/input.json
index 7b9e265eeed5c1..1e3d0cb5231d6a 100644
--- a/docs/translations/api-docs/input/input.json
+++ b/docs/translations/api-docs/input/input.json
@@ -92,6 +92,16 @@
"nodeName": "the input element",
"conditions": "multiline={true}
"
},
+ "inputAdornedStart": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the input element",
+ "conditions": "startAdornment
is provided"
+ },
+ "inputAdornedEnd": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the input element",
+ "conditions": "endAdornment
is provided"
+ },
"inputTypeSearch": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the input element",
diff --git a/docs/translations/api-docs/popper/popper.json b/docs/translations/api-docs/popper/popper.json
index b6533b390e8cf1..5743b7afdac16c 100644
--- a/docs/translations/api-docs/popper/popper.json
+++ b/docs/translations/api-docs/popper/popper.json
@@ -3,6 +3,7 @@
"propDescriptions": {
"anchorEl": "An HTML element, virtualElement , or a function that returns either. It's used to set the position of the popper. The return value will passed as the reference object of the Popper instance.",
"children": "Popper render function or node.",
+ "component": "The component used for the root node. Either a string to use a HTML element or a component.",
"components": "The components used for each slot inside the Popper. Either a string to use a HTML element or a component.",
"componentsProps": "The props used for each slot inside the Popper.",
"container": "An HTML element or function that returns one. The container
will have the portal children appended to it. By default, it uses the body of the top-level document object, so it's simply document.body
most of the time.",
diff --git a/docs/translations/api-docs/use-select/use-select.json b/docs/translations/api-docs/use-select/use-select.json
index ec626227399f64..75fb0f4fc2b414 100644
--- a/docs/translations/api-docs/use-select/use-select.json
+++ b/docs/translations/api-docs/use-select/use-select.json
@@ -5,6 +5,7 @@
"defaultOpen": "If true
, the select will be open by default.",
"defaultValue": "The default selected value. Use when the component is not controlled.",
"disabled": "If true
, the select is disabled.",
+ "getOptionAsString": "A function used to convert the option label to a string.\nThis is useful when labels are elements and need to be converted to plain text\nto enable keyboard navigation with character keys.",
"listboxId": "The id
attribute of the listbox element.",
"listboxRef": "The ref of the listbox element.",
"multiple": "If true
, the end user can select multiple values.\nThis affects the type of the value
, defaultValue
, and onChange
props.",
@@ -13,7 +14,6 @@
"onOpenChange": "Callback fired when the listbox is opened or closed.",
"open": "Controls the open state of the select's listbox.\nThis is the controlled equivalent of the defaultOpen
prop.",
"options": "An alternative way to specify the options.\nIf this parameter is set, options defined as JSX children are ignored.",
- "optionStringifier": "A function used to convert the option label to a string.\nThis is useful when labels are elements and need to be converted to plain text\nto enable keyboard navigation with character keys.",
"value": "The selected value.\nSet to null
to deselect all options."
},
"returnValueDescriptions": {
diff --git a/docs/translations/translations.json b/docs/translations/translations.json
index 5d68b5760f8a2d..d4bffd9779c435 100644
--- a/docs/translations/translations.json
+++ b/docs/translations/translations.json
@@ -218,7 +218,7 @@
"/system/styles/advanced": "Advanced",
"/base/getting-started": "Getting started",
"/base/getting-started/overview": "Overview",
- "/base/getting-started/installation": "Installation",
+ "/base/getting-started/quickstart": "Quickstart",
"/base/getting-started/usage": "Usage",
"/base/getting-started/customization": "Customization",
"/base/react-": "Components",
diff --git a/package.json b/package.json
index 8b0ae93b96a767..118ddd2aa57210 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@mui/monorepo",
- "version": "5.12.2",
+ "version": "5.12.3",
"private": true,
"scripts": {
"proptypes": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./scripts/generateProptypes.ts",
@@ -74,27 +74,27 @@
"devDependencies": {
"@argos-ci/core": "^0.8.0",
"@babel/cli": "^7.21.0",
- "@babel/core": "^7.21.3",
+ "@babel/core": "^7.21.4",
"@babel/node": "^7.20.7",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-object-assign": "^7.18.6",
"@babel/plugin-transform-react-constant-elements": "^7.21.3",
- "@babel/plugin-transform-runtime": "^7.21.0",
- "@babel/preset-env": "^7.20.2",
+ "@babel/plugin-transform-runtime": "^7.21.4",
+ "@babel/preset-env": "^7.21.4",
"@babel/preset-react": "^7.18.6",
"@babel/register": "^7.21.0",
- "@emotion/react": "^11.10.6",
- "@emotion/styled": "^11.10.6",
+ "@emotion/react": "^11.10.8",
+ "@emotion/styled": "^11.10.8",
"@googleapis/sheets": "^4.0.2",
"@mnajdova/enzyme-adapter-react-18": "^0.2.0",
"@octokit/rest": "^19.0.7",
"@playwright/test": "1.31.2",
"@rollup/plugin-replace": "^5.0.2",
- "@slack/bolt": "^3.13.0",
+ "@slack/bolt": "^3.13.1",
"@testing-library/dom": "^9.2.0",
"@testing-library/react": "^14.0.0",
- "@types/chai": "^4.3.4",
+ "@types/chai": "^4.3.5",
"@types/chai-dom": "^1.11.0",
"@types/enzyme": "^3.10.13",
"@types/format-util": "^1.0.2",
@@ -165,11 +165,11 @@
"markdownlint-cli2": "^0.6.0",
"mocha": "^10.2.0",
"node-fetch": "^2.6.9",
- "nx": "^15.9.2",
+ "nx": "^15.9.3",
"nyc": "^15.1.0",
"piscina": "^3.2.0",
"playwright": "^1.31.2",
- "prettier": "^2.8.7",
+ "prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"process": "^0.11.10",
"prop-types": "^15.8.1",
@@ -191,7 +191,7 @@
"stylelint": "^13.13.1",
"stylelint-config-standard": "^22.0.0",
"stylelint-processor-styled-components": "^1.10.0",
- "stylis": "^4.1.3",
+ "stylis": "^4.1.4",
"stylis-plugin-rtl": "^2.1.1",
"stylis-plugin-rtl-sc": "npm:stylis-plugin-rtl@^1.1.0",
"terser-webpack-plugin": "^5.3.7",
@@ -208,18 +208,18 @@
"yarn-deduplicate": "^3.1.0"
},
"resolutions": {
- "**/@babel/core": "^7.21.3",
- "**/@babel/code-frame": "^7.18.6",
+ "**/@babel/core": "^7.21.4",
+ "**/@babel/code-frame": "^7.21.4",
"**/@babel/plugin-proposal-class-properties": "^7.18.6",
"**/@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"**/@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"**/@babel/plugin-proposal-numeric-separator": "^7.18.6",
"**/@babel/plugin-proposal-optional-chaining": "^7.21.0",
"**/@babel/plugin-transform-destructuring": "npm:@minh.nguyen/plugin-transform-destructuring@^7.5.2",
- "**/@babel/plugin-transform-runtime": "^7.21.0",
- "**/@babel/preset-env": "^7.20.2",
+ "**/@babel/plugin-transform-runtime": "^7.21.4",
+ "**/@babel/preset-env": "^7.21.4",
"**/@babel/preset-react": "^7.18.6",
- "**/@babel/preset-typescript": "^7.21.0",
+ "**/@babel/preset-typescript": "^7.21.4",
"**/@babel/runtime": "^7.21.0",
"**/@definitelytyped/header-parser": "^0.0.159",
"**/@definitelytyped/typescript-versions": "^0.0.159",
diff --git a/packages/api-docs-builder/ApiBuilders/HookApiBuilder.ts b/packages/api-docs-builder/ApiBuilders/HookApiBuilder.ts
index 8e52c6e1c8a671..78978f75e06605 100644
--- a/packages/api-docs-builder/ApiBuilders/HookApiBuilder.ts
+++ b/packages/api-docs-builder/ApiBuilders/HookApiBuilder.ts
@@ -370,19 +370,16 @@ const generateApiTranslations = (outputDirectory: string, reactApi: ReactApi) =>
});
};
-const extractInfoFromInterface = (
- interfaceName: string,
- project: TypeScriptProject,
-): ParsedProperty[] => {
+const extractInfoFromType = (typeName: string, project: TypeScriptProject): ParsedProperty[] => {
// Generate the params
let result: ParsedProperty[] = [];
try {
- const exportedSymbol = project.exports[interfaceName];
+ const exportedSymbol = project.exports[typeName];
const type = project.checker.getDeclaredTypeOfSymbol(exportedSymbol);
// @ts-ignore
const typeDeclaration = type?.symbol?.declarations?.[0];
- if (!typeDeclaration || !ts.isInterfaceDeclaration(typeDeclaration)) {
+ if (!typeDeclaration) {
return [];
}
@@ -399,7 +396,7 @@ const extractInfoFromInterface = (
.filter((property) => !property.tags.ignore)
.sort((a, b) => a.name.localeCompare(b.name));
} catch (e) {
- console.error(`No declaration for ${interfaceName}`);
+ console.error(`No declaration for ${typeName}`);
}
return result;
@@ -433,8 +430,8 @@ export default async function generateHookApi(hooksInfo: HookInfo, project: Type
{ filename },
);
- const parameters = extractInfoFromInterface(`${upperFirst(name)}Parameters`, project);
- const returnValue = extractInfoFromInterface(`${upperFirst(name)}ReturnValue`, project);
+ const parameters = extractInfoFromType(`${upperFirst(name)}Parameters`, project);
+ const returnValue = extractInfoFromType(`${upperFirst(name)}ReturnValue`, project);
// Ignore what we might have generated in `annotateHookDefinition`
const annotatedDescriptionMatch = reactApi.description.match(/(Demos|API):\r?\n\r?\n/);
diff --git a/packages/api-docs-builder/package.json b/packages/api-docs-builder/package.json
index 9f7ffb08abf783..8b75c8e01e1ecd 100644
--- a/packages/api-docs-builder/package.json
+++ b/packages/api-docs-builder/package.json
@@ -7,7 +7,7 @@
"typescript": "tsc -p tsconfig.json"
},
"dependencies": {
- "@babel/core": "^7.21.3",
+ "@babel/core": "^7.21.4",
"@mui-internal/docs-utilities": "^1.0.0",
"@mui/markdown": "^5.0.0",
"ast-types": "^0.14.2",
diff --git a/packages/markdown/loader.js b/packages/markdown/loader.js
index 3b554bc502ca73..a0617a16fce174 100644
--- a/packages/markdown/loader.js
+++ b/packages/markdown/loader.js
@@ -38,9 +38,9 @@ const packages = [
{
product: 'material-ui',
paths: [
+ path.join(__dirname, '../../packages/mui-base/src'),
path.join(__dirname, '../../packages/mui-lab/src'),
path.join(__dirname, '../../packages/mui-material/src'),
- path.join(__dirname, '../../packages/mui-base/src'),
],
},
{
diff --git a/packages/markdown/parseMarkdown.js b/packages/markdown/parseMarkdown.js
index 3f83f86140638d..5de9eaf295b47e 100644
--- a/packages/markdown/parseMarkdown.js
+++ b/packages/markdown/parseMarkdown.js
@@ -370,6 +370,8 @@ function createRender(context) {
return render;
}
+const BaseUIReexportedComponents = ['ClickAwayListener'];
+
/**
* @param {string} product
* @example 'material'
@@ -386,7 +388,7 @@ function resolveComponentApiUrl(product, componentPkg, component) {
if (product === 'date-pickers') {
return `/x/api/date-pickers/${kebabCase(component)}/`;
}
- if (componentPkg === 'mui-base') {
+ if (componentPkg === 'mui-base' || BaseUIReexportedComponents.indexOf(component) >= 0) {
return `/base/api/${kebabCase(component)}/`;
}
return `/${product}/api/${kebabCase(component)}/`;
diff --git a/packages/mui-base/package.json b/packages/mui-base/package.json
index a6c61244b149f7..195255c20f8c52 100644
--- a/packages/mui-base/package.json
+++ b/packages/mui-base/package.json
@@ -1,6 +1,6 @@
{
"name": "@mui/base",
- "version": "5.0.0-alpha.127",
+ "version": "5.0.0-alpha.128",
"private": false,
"author": "MUI Team",
"description": "A library of headless ('unstyled') React UI components and low-level hooks.",
@@ -54,7 +54,7 @@
"@babel/runtime": "^7.21.0",
"@emotion/is-prop-valid": "^1.2.0",
"@mui/types": "^7.2.4",
- "@mui/utils": "^5.12.0",
+ "@mui/utils": "^5.12.3",
"@popperjs/core": "^2.11.7",
"clsx": "^1.2.1",
"prop-types": "^15.8.1",
diff --git a/packages/mui-base/src/Badge/Badge.spec.tsx b/packages/mui-base/src/Badge/Badge.spec.tsx
index 9010d01679871f..970ff73baf15ed 100644
--- a/packages/mui-base/src/Badge/Badge.spec.tsx
+++ b/packages/mui-base/src/Badge/Badge.spec.tsx
@@ -26,24 +26,48 @@ const polymorphicComponentTest = () => {
return
;
};
+ const CustomRoot = function CustomRoot() {
+ return
;
+ };
+
return (
{/* @ts-expect-error */}
-
+
+ slots={{
+ root: 'a',
+ }}
+ href="#"
+ />
-
- {/* @ts-expect-error */}
-
+
+ slots={{
+ root: CustomComponent,
+ }}
+ stringProp="test"
+ numberProp={0}
+ />
+
+ {/* @ts-expect-error required props not specified */}
+
+ slots={{
+ root: CustomComponent,
+ }}
+ />
) => e.currentTarget.checkValidity()}
/>
- component="button"
+ slots={{
+ root: 'button',
+ }}
ref={(elem) => {
expectType(elem);
}}
@@ -52,6 +76,8 @@ const polymorphicComponentTest = () => {
e.currentTarget.checkValidity();
}}
/>
+
+ viewBox="" />
);
};
diff --git a/packages/mui-base/src/Badge/Badge.test.tsx b/packages/mui-base/src/Badge/Badge.test.tsx
index 61a19646646413..2cc51f3f8deb4f 100644
--- a/packages/mui-base/src/Badge/Badge.test.tsx
+++ b/packages/mui-base/src/Badge/Badge.test.tsx
@@ -26,6 +26,7 @@ describe(' ', () => {
expectedClassName: classes.badge,
},
},
+ skip: ['componentProp'],
}),
);
});
diff --git a/packages/mui-base/src/Badge/Badge.tsx b/packages/mui-base/src/Badge/Badge.tsx
index 3936c21e8c4b3d..729e69ad8ee7f3 100644
--- a/packages/mui-base/src/Badge/Badge.tsx
+++ b/packages/mui-base/src/Badge/Badge.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import PropTypes from 'prop-types';
-import { OverridableComponent } from '@mui/types';
+import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import composeClasses from '../composeClasses';
import useBadge from '../useBadge';
import { getBadgeUtilityClass } from './badgeClasses';
@@ -40,7 +40,6 @@ const Badge = React.forwardRef(function Badge = useSlotProps({
elementType: Root,
externalSlotProps: slotProps.root,
@@ -77,7 +76,7 @@ const Badge = React.forwardRef(function Badge = useSlotProps({
elementType: BadgeComponent,
externalSlotProps: slotProps.badge,
@@ -91,7 +90,7 @@ const Badge = React.forwardRef(function Badge{displayValue}
);
-}) as OverridableComponent;
+}) as PolymorphicComponent;
Badge.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
@@ -106,11 +105,6 @@ Badge.propTypes /* remove-proptypes */ = {
* The badge will be added relative to this node.
*/
children: PropTypes.node,
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: PropTypes.elementType,
/**
* If `true`, the badge is invisible.
* @default false
diff --git a/packages/mui-base/src/FormControl/FormControl.spec.tsx b/packages/mui-base/src/FormControl/FormControl.spec.tsx
index 8ef3d66d1a8cc8..f13a167aa9ab2e 100644
--- a/packages/mui-base/src/FormControl/FormControl.spec.tsx
+++ b/packages/mui-base/src/FormControl/FormControl.spec.tsx
@@ -15,19 +15,39 @@ function FormControlTest() {
{/* @ts-expect-error */}
-
+
+ slots={{
+ root: 'a',
+ }}
+ href="#"
+ />
+
+
+ slots={{
+ root: CustomComponent,
+ }}
+ stringProp="test"
+ numberProp={0}
+ />
-
{/* @ts-expect-error */}
-
+
+ slots={{
+ root: CustomComponent,
+ }}
+ />
-
+ slots={{
+ root: 'button',
+ }}
onClick={(e: React.MouseEvent) => e.currentTarget.checkValidity()}
/>
- component="button"
+ slots={{
+ root: 'button',
+ }}
ref={(elem) => {
expectType(elem);
}}
diff --git a/packages/mui-base/src/FormControl/FormControl.test.tsx b/packages/mui-base/src/FormControl/FormControl.test.tsx
index 9e14724f157d3a..e5d7c991ae6b2b 100644
--- a/packages/mui-base/src/FormControl/FormControl.test.tsx
+++ b/packages/mui-base/src/FormControl/FormControl.test.tsx
@@ -20,6 +20,7 @@ describe(' ', () => {
expectedClassName: formControlClasses.root,
},
},
+ skip: ['componentProp'],
}));
describe('initial state', () => {
diff --git a/packages/mui-base/src/FormControl/FormControl.tsx b/packages/mui-base/src/FormControl/FormControl.tsx
index f79f77647eaa2b..96463d1438f51d 100644
--- a/packages/mui-base/src/FormControl/FormControl.tsx
+++ b/packages/mui-base/src/FormControl/FormControl.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';
-import { OverridableComponent } from '@mui/types';
import { unstable_useControlled as useControlled } from '@mui/utils';
+import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import FormControlContext from './FormControlContext';
import { getFormControlUtilityClass } from './formControlClasses';
import {
@@ -80,7 +80,6 @@ const FormControl = React.forwardRef(function FormControl<
const {
defaultValue,
children,
- component,
disabled = false,
error = false,
onChange,
@@ -145,7 +144,7 @@ const FormControl = React.forwardRef(function FormControl<
return children;
};
- const Root = component ?? slots.root ?? 'div';
+ const Root = slots.root ?? 'div';
const rootProps: WithOptionalOwnerState = useSlotProps({
elementType: Root,
externalSlotProps: slotProps.root,
@@ -163,7 +162,7 @@ const FormControl = React.forwardRef(function FormControl<
);
-}) as OverridableComponent;
+}) as PolymorphicComponent;
FormControl.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
@@ -177,11 +176,6 @@ FormControl.propTypes /* remove-proptypes */ = {
PropTypes.node,
PropTypes.func,
]),
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: PropTypes.elementType,
/**
* @ignore
*/
diff --git a/packages/mui-base/src/FormControl/FormControl.types.ts b/packages/mui-base/src/FormControl/FormControl.types.ts
index faa33734da2979..bd76fbedc2a050 100644
--- a/packages/mui-base/src/FormControl/FormControl.types.ts
+++ b/packages/mui-base/src/FormControl/FormControl.types.ts
@@ -1,6 +1,6 @@
import * as React from 'react';
-import { OverrideProps, Simplify } from '@mui/types';
-import { SlotComponentProps } from '../utils';
+import { Simplify } from '@mui/types';
+import { PolymorphicProps, SlotComponentProps } from '../utils';
export type NativeFormControlElement = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
@@ -72,9 +72,7 @@ export interface FormControlTypeMap<
export type FormControlProps<
RootComponentType extends React.ElementType = FormControlTypeMap['defaultComponent'],
-> = OverrideProps, RootComponentType> & {
- component?: RootComponentType;
-};
+> = PolymorphicProps, RootComponentType>;
type NonOptionalOwnerState = 'disabled' | 'error' | 'required';
@@ -86,28 +84,44 @@ export type FormControlOwnerState = Simplify<
}
>;
-type ContextFromPropsKey = 'disabled' | 'error' | 'onChange' | 'required' | 'value';
-
-export type FormControlState = Simplify<
- Pick & {
- /**
- * If `true`, the form element has some value.
- */
- filled: boolean;
- /**
- * If `true`, the form element is focused and not disabled.
- */
- focused: boolean;
- /**
- * Callback fired when the form element has lost focus.
- */
- onBlur: () => void;
- /**
- * Callback fired when the form element receives focus.
- */
- onFocus: () => void;
- }
->;
+export type FormControlState = {
+ /**
+ * If `true`, the label, input and helper text should be displayed in a disabled state.
+ */
+ disabled: boolean;
+ /**
+ * If `true`, the label is displayed in an error state.
+ */
+ error: boolean;
+ /**
+ * If `true`, the form element has some value.
+ */
+ filled: boolean;
+ /**
+ * If `true`, the form element is focused and not disabled.
+ */
+ focused: boolean;
+ /**
+ * Callback fired when the form element has lost focus.
+ */
+ onBlur: () => void;
+ /**
+ * Callback fired when the form element's value is modified.
+ */
+ onChange: React.ChangeEventHandler;
+ /**
+ * Callback fired when the form element receives focus.
+ */
+ onFocus: () => void;
+ /**
+ * If `true`, the label will indicate that the `input` is required.
+ */
+ required: boolean;
+ /**
+ * The value of the form element.
+ */
+ value: unknown;
+};
export type FormControlRootSlotProps = {
children: React.ReactNode | ((state: FormControlState) => React.ReactNode);
diff --git a/packages/mui-base/src/Input/Input.spec.tsx b/packages/mui-base/src/Input/Input.spec.tsx
index f75c39e22835d7..1fe1463fef4c8b 100644
--- a/packages/mui-base/src/Input/Input.spec.tsx
+++ b/packages/mui-base/src/Input/Input.spec.tsx
@@ -31,19 +31,38 @@ const polymorphicComponentTest = () => {
{/* @ts-expect-error */}
-
+
+ slots={{
+ root: 'a',
+ }}
+ href="#"
+ />
-
+
+ slots={{
+ root: CustomComponent,
+ }}
+ stringProp="test"
+ numberProp={0}
+ />
{/* @ts-expect-error */}
-
+
+ slots={{
+ root: CustomComponent,
+ }}
+ />
-
+ slots={{
+ root: 'button',
+ }}
onClick={(e: React.MouseEvent) => e.currentTarget.checkValidity()}
/>
- component="button"
+ slots={{
+ root: 'button',
+ }}
ref={(elem) => {
expectType(elem);
}}
diff --git a/packages/mui-base/src/Input/Input.test.tsx b/packages/mui-base/src/Input/Input.test.tsx
index 6a0e92ca71acf4..b7c537c132a048 100644
--- a/packages/mui-base/src/Input/Input.test.tsx
+++ b/packages/mui-base/src/Input/Input.test.tsx
@@ -23,6 +23,7 @@ describe(' ', () => {
testWithElement: 'input',
},
},
+ skip: ['componentProp'],
}));
it('should render textarea without any console errors when multiline=true', () => {
diff --git a/packages/mui-base/src/Input/Input.tsx b/packages/mui-base/src/Input/Input.tsx
index 2ce2cad7adc565..2929059bd48c32 100644
--- a/packages/mui-base/src/Input/Input.tsx
+++ b/packages/mui-base/src/Input/Input.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import PropTypes from 'prop-types';
-import { OverridableComponent } from '@mui/types';
+import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import isHostComponent from '../utils/isHostComponent';
import { getInputUtilityClass } from './inputClasses';
import {
@@ -57,7 +57,6 @@ const Input = React.forwardRef(function Input = useSlotProps({
elementType: Root,
getSlotProps: getRootProps,
@@ -182,7 +181,7 @@ const Input = React.forwardRef(function Input
);
-}) as OverridableComponent;
+}) as PolymorphicComponent;
Input.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
@@ -211,23 +210,10 @@ Input.propTypes /* remove-proptypes */ = {
* If `true`, the `input` element is focused during the first mount.
*/
autoFocus: PropTypes.bool,
- /**
- * @ignore
- */
- children: PropTypes.node,
/**
* Class name applied to the root element.
*/
className: PropTypes.string,
- /**
- * @ignore
- */
- color: PropTypes.string,
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: PropTypes.elementType,
/**
* The default value. Use when the component is not controlled.
*/
diff --git a/packages/mui-base/src/Input/Input.types.ts b/packages/mui-base/src/Input/Input.types.ts
index 71d142d22defe5..e2b0a9e0ae96c0 100644
--- a/packages/mui-base/src/Input/Input.types.ts
+++ b/packages/mui-base/src/Input/Input.types.ts
@@ -1,8 +1,8 @@
import * as React from 'react';
-import { OverrideProps, Simplify } from '@mui/types';
+import { Simplify } from '@mui/types';
import { FormControlState } from '../FormControl';
import { UseInputParameters, UseInputRootSlotProps } from '../useInput';
-import { SlotComponentProps } from '../utils';
+import { PolymorphicProps, SlotComponentProps } from '../utils';
export interface InputRootSlotPropsOverrides {}
export interface InputInputSlotPropsOverrides {}
@@ -156,9 +156,7 @@ export interface InputTypeMap<
export type InputProps<
RootComponentType extends React.ElementType = InputTypeMap['defaultComponent'],
-> = OverrideProps, RootComponentType> & {
- component?: RootComponentType;
-};
+> = PolymorphicProps, RootComponentType>;
export type InputOwnerState = Simplify<
InputOwnProps & {
diff --git a/packages/mui-base/src/Menu/Menu.spec.tsx b/packages/mui-base/src/Menu/Menu.spec.tsx
index ad3db2f64a265b..2429c1772de7a9 100644
--- a/packages/mui-base/src/Menu/Menu.spec.tsx
+++ b/packages/mui-base/src/Menu/Menu.spec.tsx
@@ -13,19 +13,39 @@ const polymorphicComponentTest = () => {
{/* @ts-expect-error */}
-
+
+ slots={{
+ root: 'a',
+ }}
+ href="#"
+ />
-
- {/* @ts-expect-error */}
-
+
+ slots={{
+ root: CustomComponent,
+ }}
+ stringProp="test"
+ numberProp={0}
+ />
-
+ slots={{
+ root: CustomComponent,
+ }}
+ />
+
+
+ slots={{
+ root: 'button',
+ }}
onClick={(e: React.MouseEvent) => e.currentTarget.checkValidity()}
/>
- component="button"
+ slots={{
+ root: 'button',
+ }}
ref={(elem) => {
expectType(elem);
}}
diff --git a/packages/mui-base/src/Menu/Menu.tsx b/packages/mui-base/src/Menu/Menu.tsx
index 41c463e4da7976..be2cf8f8e43024 100644
--- a/packages/mui-base/src/Menu/Menu.tsx
+++ b/packages/mui-base/src/Menu/Menu.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { HTMLElementType, refType } from '@mui/utils';
-import { OverridableComponent } from '@mui/types';
+import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import { MenuOwnerState, MenuProps, MenuRootSlotProps, MenuTypeMap } from './Menu.types';
import { getMenuUtilityClass } from './menuClasses';
import useMenu from '../useMenu';
@@ -39,7 +39,6 @@ const Menu = React.forwardRef(function Menu = useSlotProps({
elementType: Root,
externalForwardedProps: other,
@@ -100,7 +99,7 @@ const Menu = React.forwardRef(function Menu
);
-}) as OverridableComponent;
+}) as PolymorphicComponent;
Menu.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
@@ -126,11 +125,6 @@ Menu.propTypes /* remove-proptypes */ = {
* @ignore
*/
children: PropTypes.node,
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: PropTypes.elementType,
/**
* @ignore
*/
@@ -152,7 +146,7 @@ Menu.propTypes /* remove-proptypes */ = {
* The props used for each slot inside the Menu.
* @default {}
*/
- slotProps: PropTypes.shape({
+ slotProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({
listbox: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
}),
diff --git a/packages/mui-base/src/Menu/Menu.types.ts b/packages/mui-base/src/Menu/Menu.types.ts
index fa8ccca77518c8..1a48a9074eaaf2 100644
--- a/packages/mui-base/src/Menu/Menu.types.ts
+++ b/packages/mui-base/src/Menu/Menu.types.ts
@@ -1,7 +1,7 @@
import * as React from 'react';
-import { OverrideProps, Simplify } from '@mui/types';
+import { Simplify } from '@mui/types';
import Popper, { PopperProps } from '../Popper';
-import { SlotComponentProps } from '../utils';
+import { PolymorphicProps, SlotComponentProps } from '../utils';
import { UseMenuListboxSlotProps } from '../useMenu';
import { ListAction } from '../useList';
@@ -76,9 +76,7 @@ export interface MenuTypeMap<
export type MenuProps<
RootComponentType extends React.ElementType = MenuTypeMap['defaultComponent'],
-> = OverrideProps, RootComponentType> & {
- component?: RootComponentType;
-};
+> = PolymorphicProps, RootComponentType>;
export type MenuOwnerState = Simplify<
MenuOwnProps & {
diff --git a/packages/mui-base/src/MenuItem/MenuItem.spec.tsx b/packages/mui-base/src/MenuItem/MenuItem.spec.tsx
index 7b728eb48cee49..c9091143378303 100644
--- a/packages/mui-base/src/MenuItem/MenuItem.spec.tsx
+++ b/packages/mui-base/src/MenuItem/MenuItem.spec.tsx
@@ -13,19 +13,39 @@ const polymorphicComponentTest = () => {
{/* @ts-expect-error */}
-
+
+ slots={{
+ root: 'a',
+ }}
+ href="#"
+ />
-
- {/* @ts-expect-error */}
-
+
+ slots={{
+ root: CustomComponent,
+ }}
+ stringProp="test"
+ numberProp={0}
+ />
-
+ slots={{
+ root: CustomComponent,
+ }}
+ />
+
+
+ slots={{
+ root: 'button',
+ }}
onClick={(e: React.MouseEvent) => e.currentTarget.checkValidity()}
/>
- component="button"
+ slots={{
+ root: 'button',
+ }}
ref={(elem) => {
expectType(elem);
}}
diff --git a/packages/mui-base/src/MenuItem/MenuItem.test.tsx b/packages/mui-base/src/MenuItem/MenuItem.test.tsx
index 24d36cae81d292..706086041a6982 100644
--- a/packages/mui-base/src/MenuItem/MenuItem.test.tsx
+++ b/packages/mui-base/src/MenuItem/MenuItem.test.tsx
@@ -45,6 +45,7 @@ describe(' ', () => {
},
},
skip: [
+ 'componentProp',
'reactTestRenderer', // Need to be wrapped in MenuContext
],
}));
diff --git a/packages/mui-base/src/MenuItem/MenuItem.tsx b/packages/mui-base/src/MenuItem/MenuItem.tsx
index 7786d99a7251cb..4b085b0e9477dc 100644
--- a/packages/mui-base/src/MenuItem/MenuItem.tsx
+++ b/packages/mui-base/src/MenuItem/MenuItem.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import PropTypes from 'prop-types';
-import { OverridableComponent } from '@mui/types';
+import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import { MenuItemOwnerState, MenuItemProps, MenuItemTypeMap } from './MenuItem.types';
import { getMenuItemUtilityClass } from './menuItemClasses';
import useMenuItem from '../useMenuItem';
@@ -35,7 +35,6 @@ const MenuItem = React.forwardRef(function MenuItem{children};
-}) as OverridableComponent;
+}) as PolymorphicComponent;
MenuItem.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
@@ -74,11 +73,6 @@ MenuItem.propTypes /* remove-proptypes */ = {
* @ignore
*/
children: PropTypes.node,
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: PropTypes.elementType,
/**
* @ignore
*/
diff --git a/packages/mui-base/src/MenuItem/MenuItem.types.ts b/packages/mui-base/src/MenuItem/MenuItem.types.ts
index 43f9454a7357aa..63b0b3fadfeaa2 100644
--- a/packages/mui-base/src/MenuItem/MenuItem.types.ts
+++ b/packages/mui-base/src/MenuItem/MenuItem.types.ts
@@ -1,6 +1,6 @@
import * as React from 'react';
-import { OverrideProps, Simplify } from '@mui/types';
-import { SlotComponentProps } from '../utils';
+import { Simplify } from '@mui/types';
+import { PolymorphicProps, SlotComponentProps } from '../utils';
export interface MenuItemRootSlotPropsOverrides {}
@@ -59,9 +59,7 @@ export interface MenuItemTypeMap<
export type MenuItemProps<
RootComponentType extends React.ElementType = MenuItemTypeMap['defaultComponent'],
-> = OverrideProps, RootComponentType> & {
- component?: RootComponentType;
-};
+> = PolymorphicProps, RootComponentType>;
export interface MenuItemState {
disabled: boolean;
diff --git a/packages/mui-base/src/Modal/Modal.spec.tsx b/packages/mui-base/src/Modal/Modal.spec.tsx
index 6e97a1c845ef2c..fe3f92641fb8f6 100644
--- a/packages/mui-base/src/Modal/Modal.spec.tsx
+++ b/packages/mui-base/src/Modal/Modal.spec.tsx
@@ -29,21 +29,41 @@ const polymorphicComponentTest = () => {
{/* @ts-expect-error */}
-
+
+ slots={{
+ root: 'a',
+ }}
+ href="#"
+ open
+ >
-
+
+ slots={{
+ root: CustomComponent,
+ }}
+ stringProp="test"
+ numberProp={0}
+ open
+ >
{/* @ts-expect-error */}
-
+
+ slots={{
+ root: CustomComponent,
+ }}
+ open
+ >
-
+ slots={{
+ root: 'button',
+ }}
onClick={(e: React.MouseEvent) => e.currentTarget.checkValidity()}
open
>
@@ -51,7 +71,9 @@ const polymorphicComponentTest = () => {
- component="button"
+ slots={{
+ root: 'button',
+ }}
ref={(elem) => {
expectType(elem);
}}
diff --git a/packages/mui-base/src/Modal/Modal.test.tsx b/packages/mui-base/src/Modal/Modal.test.tsx
index 8433e7c0374320..17f23cd4084270 100644
--- a/packages/mui-base/src/Modal/Modal.test.tsx
+++ b/packages/mui-base/src/Modal/Modal.test.tsx
@@ -31,6 +31,7 @@ describe(' ', () => {
},
},
skip: [
+ 'componentProp',
'reactTestRenderer', // portal https://github.com/facebook/react/issues/11565
],
}),
diff --git a/packages/mui-base/src/Modal/Modal.tsx b/packages/mui-base/src/Modal/Modal.tsx
index c2e95b3b85e416..77339544c4bcbb 100644
--- a/packages/mui-base/src/Modal/Modal.tsx
+++ b/packages/mui-base/src/Modal/Modal.tsx
@@ -8,7 +8,7 @@ import {
unstable_createChainedFunction as createChainedFunction,
unstable_useEventCallback as useEventCallback,
} from '@mui/utils';
-import { OverridableComponent } from '@mui/types';
+import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import { ModalOwnerState, ModalOwnProps, ModalProps, ModalTypeMap } from './Modal.types';
import composeClasses from '../composeClasses';
import Portal from '../Portal';
@@ -69,7 +69,6 @@ const Modal = React.forwardRef(function Modal
);
-}) as OverridableComponent;
+}) as PolymorphicComponent;
Modal.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
@@ -329,11 +330,6 @@ Modal.propTypes /* remove-proptypes */ = {
* @default false
*/
closeAfterTransition: PropTypes.bool,
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: PropTypes.elementType,
/**
* An HTML element or function that returns one.
* The `container` will have the portal children appended to it.
@@ -409,10 +405,6 @@ Modal.propTypes /* remove-proptypes */ = {
* @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
*/
onClose: PropTypes.func,
- /**
- * @ignore
- */
- onKeyDown: PropTypes.func,
/**
* If `true`, the component is shown.
*/
diff --git a/packages/mui-base/src/Modal/Modal.types.ts b/packages/mui-base/src/Modal/Modal.types.ts
index 586d49124f4a3c..5062fc72410767 100644
--- a/packages/mui-base/src/Modal/Modal.types.ts
+++ b/packages/mui-base/src/Modal/Modal.types.ts
@@ -1,7 +1,7 @@
import * as React from 'react';
-import { OverridableComponent, OverridableTypeMap, OverrideProps, Simplify } from '@mui/types';
+import { OverridableComponent, OverridableTypeMap, Simplify } from '@mui/types';
import { PortalProps } from '../Portal';
-import { SlotComponentProps } from '../utils';
+import { PolymorphicProps, SlotComponentProps } from '../utils';
export interface ModalRootSlotPropsOverrides {}
export interface ModalBackdropSlotPropsOverrides {}
@@ -142,7 +142,7 @@ export type ExtendModal = OverridableComponent = OverrideProps, RootComponentType>;
+> = PolymorphicProps, RootComponentType>;
export type ModalOwnerState = Simplify<
ModalOwnProps & {
diff --git a/packages/mui-base/src/Option/Option.spec.tsx b/packages/mui-base/src/Option/Option.spec.tsx
index c8e7aeaa33a537..ea49a8871a5782 100644
--- a/packages/mui-base/src/Option/Option.spec.tsx
+++ b/packages/mui-base/src/Option/Option.spec.tsx
@@ -24,21 +24,43 @@ const polymorphicComponentTest = () => {
{/* @ts-expect-error */}
-
+
+ value={1}
+ slots={{
+ root: 'a',
+ }}
+ href="#"
+ />
-
+
+ value={1}
+ slots={{
+ root: CustomComponent,
+ }}
+ stringProp="test"
+ numberProp={0}
+ />
{/* @ts-expect-error */}
-
+
+ value={1}
+ slots={{
+ root: CustomComponent,
+ }}
+ />
-
value={1}
- component="button"
+ slots={{
+ root: 'button',
+ }}
onClick={(e: React.MouseEvent) => e.currentTarget.checkValidity()}
/>
value={1}
- component="button"
+ slots={{
+ root: 'button',
+ }}
ref={(elem) => {
expectType(elem);
}}
diff --git a/packages/mui-base/src/Option/Option.test.tsx b/packages/mui-base/src/Option/Option.test.tsx
index 16fa74a8dfac3a..f65273850d9279 100644
--- a/packages/mui-base/src/Option/Option.test.tsx
+++ b/packages/mui-base/src/Option/Option.test.tsx
@@ -61,6 +61,7 @@ describe(' ', () => {
},
},
skip: [
+ 'componentProp',
'reactTestRenderer', // Need to be wrapped in SelectContext
],
}));
diff --git a/packages/mui-base/src/Option/Option.tsx b/packages/mui-base/src/Option/Option.tsx
index 7ecb1ef8091662..b699bd184e658a 100644
--- a/packages/mui-base/src/Option/Option.tsx
+++ b/packages/mui-base/src/Option/Option.tsx
@@ -25,18 +25,9 @@ const Option = React.forwardRef(function Option<
OptionValue,
RootComponentType extends React.ElementType,
>(props: OptionProps, forwardedRef: React.ForwardedRef) {
- const {
- children,
- component,
- disabled = false,
- label,
- slotProps = {},
- slots = {},
- value,
- ...other
- } = props;
+ const { children, disabled = false, label, slotProps = {}, slots = {}, value, ...other } = props;
- const Root = component || slots.root || 'li';
+ const Root = slots.root ?? 'li';
const optionRef = React.useRef(null);
const combinedRef = useForkRef(optionRef, forwardedRef);
@@ -84,11 +75,6 @@ Option.propTypes /* remove-proptypes */ = {
* @ignore
*/
children: PropTypes.node,
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: PropTypes.elementType,
/**
* If `true`, the option will be disabled.
* @default false
diff --git a/packages/mui-base/src/Option/Option.types.ts b/packages/mui-base/src/Option/Option.types.ts
index c87e9f911d39be..b0ee3028d4babf 100644
--- a/packages/mui-base/src/Option/Option.types.ts
+++ b/packages/mui-base/src/Option/Option.types.ts
@@ -1,7 +1,7 @@
import * as React from 'react';
-import { DefaultComponentProps, OverrideProps, Simplify } from '@mui/types';
+import { Simplify } from '@mui/types';
import { UseOptionRootSlotProps } from '../useOption';
-import { SlotComponentProps } from '../utils';
+import { PolymorphicProps, SlotComponentProps } from '../utils';
export interface OptionRootSlotPropsOverrides {}
@@ -57,22 +57,17 @@ export interface OptionTypeMap<
export type OptionProps<
OptionValue,
RootComponentType extends React.ElementType = OptionTypeMap['defaultComponent'],
-> = OverrideProps, RootComponentType> & {
- component?: RootComponentType;
-};
+> = PolymorphicProps, RootComponentType>;
export interface OptionType {
- (
- props: {
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: RootComponentType;
- } & OverrideProps, RootComponentType>,
+ <
+ OptionValue,
+ RootComponentType extends React.ElementType = OptionTypeMap['defaultComponent'],
+ >(
+ props: PolymorphicProps, RootComponentType>,
): JSX.Element | null;
- (props: DefaultComponentProps>): JSX.Element | null;
propTypes?: any;
+ displayName?: string | undefined;
}
export type OptionOwnerState = Simplify<
diff --git a/packages/mui-base/src/OptionGroup/OptionGroup.spec.tsx b/packages/mui-base/src/OptionGroup/OptionGroup.spec.tsx
index ced9b219a7bd49..b1a68c0df60c06 100644
--- a/packages/mui-base/src/OptionGroup/OptionGroup.spec.tsx
+++ b/packages/mui-base/src/OptionGroup/OptionGroup.spec.tsx
@@ -40,19 +40,38 @@ const polymorphicComponentTest = () => {
{/* @ts-expect-error */}
-
+
+ slots={{
+ root: 'a',
+ }}
+ href="#"
+ />
-
+
+ slots={{
+ root: CustomComponent,
+ }}
+ stringProp="test"
+ numberProp={0}
+ />
{/* @ts-expect-error */}
-
+
+ slots={{
+ root: CustomComponent,
+ }}
+ />
-
+ slots={{
+ root: 'button',
+ }}
onClick={(e: React.MouseEvent) => e.currentTarget.checkValidity()}
/>
- component="button"
+ slots={{
+ root: 'button',
+ }}
ref={(elem) => {
expectType(elem);
}}
diff --git a/packages/mui-base/src/OptionGroup/OptionGroup.test.tsx b/packages/mui-base/src/OptionGroup/OptionGroup.test.tsx
index e4a64caba66355..ddf2a4cd58f958 100644
--- a/packages/mui-base/src/OptionGroup/OptionGroup.test.tsx
+++ b/packages/mui-base/src/OptionGroup/OptionGroup.test.tsx
@@ -25,6 +25,7 @@ describe(' ', () => {
},
},
skip: [
+ 'componentProp',
'ownerStatePropagation', // the component does not have its own state
],
}));
diff --git a/packages/mui-base/src/OptionGroup/OptionGroup.tsx b/packages/mui-base/src/OptionGroup/OptionGroup.tsx
index 8f4d8ebf8b2c8d..e8442bc791db0f 100644
--- a/packages/mui-base/src/OptionGroup/OptionGroup.tsx
+++ b/packages/mui-base/src/OptionGroup/OptionGroup.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import PropTypes from 'prop-types';
-import { OverridableComponent } from '@mui/types';
+import { PolymorphicComponent } from '../utils/PolymorphicComponent';
import composeClasses from '../composeClasses';
import { getOptionGroupUtilityClass } from './optionGroupClasses';
import {
@@ -37,9 +37,9 @@ function useUtilityClasses(disabled: boolean) {
const OptionGroup = React.forwardRef(function OptionGroup<
RootComponentType extends React.ElementType,
>(props: OptionGroupProps, forwardedRef: React.ForwardedRef) {
- const { component, disabled = false, slotProps = {}, slots = {}, ...other } = props;
+ const { disabled = false, slotProps = {}, slots = {}, ...other } = props;
- const Root = component || slots?.root || 'li';
+ const Root = slots?.root || 'li';
const Label = slots?.label || 'span';
const List = slots?.list || 'ul';
@@ -76,7 +76,7 @@ const OptionGroup = React.forwardRef(function OptionGroup<
{props.children}
);
-}) as OverridableComponent;
+}) as PolymorphicComponent;
OptionGroup.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
@@ -87,11 +87,6 @@ OptionGroup.propTypes /* remove-proptypes */ = {
* @ignore
*/
children: PropTypes.node,
- /**
- * The component used for the root node.
- * Either a string to use a HTML element or a component.
- */
- component: PropTypes.elementType,
/**
* If `true` all the options in the group will be disabled.
* @default false
diff --git a/packages/mui-base/src/OptionGroup/OptionGroup.types.ts b/packages/mui-base/src/OptionGroup/OptionGroup.types.ts
index 709d3c7c512b32..6069bbeb6dcb4c 100644
--- a/packages/mui-base/src/OptionGroup/OptionGroup.types.ts
+++ b/packages/mui-base/src/OptionGroup/OptionGroup.types.ts
@@ -1,6 +1,5 @@
-import { OverrideProps } from '@mui/types';
import * as React from 'react';
-import { SlotComponentProps } from '../utils';
+import { PolymorphicProps, SlotComponentProps } from '../utils';
export interface OptionGroupRootSlotPropsOverrides {}
export interface OptionGroupLabelSlotPropsOverrides {}
@@ -63,9 +62,7 @@ export interface OptionGroupTypeMap<
export type OptionGroupProps<
RootComponentType extends React.ElementType = OptionGroupTypeMap['defaultComponent'],
-> = OverrideProps, RootComponentType> & {
- component?: RootComponentType;
-};
+> = PolymorphicProps, RootComponentType>;
export type OptionGroupOwnerState = OptionGroupOwnProps;
diff --git a/packages/mui-base/src/Popper/Popper.spec.tsx b/packages/mui-base/src/Popper/Popper.spec.tsx
index 92be9af3c4782f..4b8f363526a1ed 100644
--- a/packages/mui-base/src/Popper/Popper.spec.tsx
+++ b/packages/mui-base/src/Popper/Popper.spec.tsx
@@ -26,21 +26,26 @@ const polymorphicComponentTest = () => {
{/* @ts-expect-error */}
-
+ open slots={{ root: 'a' }} href="#" />
-
+
+ open
+ slots={{ root: CustomComponent }}
+ stringProp="test"
+ numberProp={0}
+ />
{/* @ts-expect-error */}
-
open
- component="button"
+ slots={{ root: 'button' }}
onClick={(e: React.MouseEvent) => e.currentTarget.checkValidity()}
/>
open
- component="button"
+ slots={{ root: 'button' }}
ref={(elem) => {
expectType(elem);
}}
diff --git a/packages/mui-base/src/Popper/Popper.test.tsx b/packages/mui-base/src/Popper/Popper.test.tsx
index 32ba2cb6ad2592..5d7205871c7f4b 100644
--- a/packages/mui-base/src/Popper/Popper.test.tsx
+++ b/packages/mui-base/src/Popper/Popper.test.tsx
@@ -21,6 +21,7 @@ describe(' ', () => {
skip: [
// https://github.com/facebook/react/issues/11565
'reactTestRenderer',
+ 'componentProp',
],
slots: {
root: {
@@ -37,8 +38,7 @@ describe(' ', () => {
document.createElement('div')}
open
- component={CustomComponent}
- ownerState={{ id: 'id' }}
+ slots={{ root: CustomComponent }}
/>,
);
diff --git a/packages/mui-base/src/Popper/Popper.tsx b/packages/mui-base/src/Popper/Popper.tsx
index 95208a0e67771d..ced7791f52031f 100644
--- a/packages/mui-base/src/Popper/Popper.tsx
+++ b/packages/mui-base/src/Popper/Popper.tsx
@@ -1,5 +1,4 @@
import * as React from 'react';
-import { OverridableComponent } from '@mui/types';
import {
chainPropTypes,
HTMLElementType,
@@ -13,7 +12,7 @@ import PropTypes from 'prop-types';
import composeClasses from '../composeClasses';
import Portal from '../Portal';
import { getPopperUtilityClass } from './popperClasses';
-import { useSlotProps, WithOptionalOwnerState } from '../utils';
+import { PolymorphicComponent, useSlotProps, WithOptionalOwnerState } from '../utils';
import {
PopperPlacementType,
PopperTooltipProps,
@@ -81,7 +80,6 @@ const PopperTooltip = React.forwardRef(function PopperTooltip<
const {
anchorEl,
children,
- component,
direction,
disablePortal,
modifiers,
@@ -216,7 +214,7 @@ const PopperTooltip = React.forwardRef(function PopperTooltip<
}
const classes = useUtilityClasses();
- const Root = component ?? slots.root ?? 'div';
+ const Root = slots.root ?? 'div';
const rootProps: WithOptionalOwnerState = useSlotProps({
elementType: Root,
@@ -233,7 +231,7 @@ const PopperTooltip = React.forwardRef(function PopperTooltip<
return (
{typeof children === 'function' ? children(childProps) : children}
);
-}) as OverridableComponent;
+}) as PolymorphicComponent;
/**
* Poppers rely on the 3rd party library [Popper.js](https://popper.js.org/docs/v2/) for positioning.
@@ -335,7 +333,7 @@ const Popper = React.forwardRef(function Popper
);
-}) as OverridableComponent;
+}) as PolymorphicComponent;
Popper.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
@@ -533,10 +531,6 @@ Popper.propTypes /* remove-proptypes */ = {
slots: PropTypes.shape({
root: PropTypes.elementType,
}),
- /**
- * @ignore
- */
- style: PropTypes.object,
/**
* Help supporting a react-transition-group/Transition component.
* @default false
diff --git a/packages/mui-base/src/Popper/Popper.types.ts b/packages/mui-base/src/Popper/Popper.types.ts
index 9a7e1df513b8f7..f5c100dea6ce3e 100644
--- a/packages/mui-base/src/Popper/Popper.types.ts
+++ b/packages/mui-base/src/Popper/Popper.types.ts
@@ -1,8 +1,7 @@
import * as React from 'react';
-import { OverrideProps } from '@mui/types';
import { Instance, Options, OptionsGeneric, VirtualElement } from '@popperjs/core';
import { PortalProps } from '../Portal';
-import { SlotComponentProps } from '../utils';
+import { PolymorphicProps, SlotComponentProps } from '../utils';
export type PopperPlacementType = Options['placement'];
@@ -124,9 +123,7 @@ export interface PopperTypeMap<
export type PopperProps<
RootComponentType extends React.ElementType = PopperTypeMap['defaultComponent'],
-> = OverrideProps, RootComponentType> & {
- component?: RootComponentType;
-};
+> = PolymorphicProps, RootComponentType>;
export type PopperTooltipOwnProps = Omit<
PopperOwnProps,
@@ -145,9 +142,7 @@ export interface PopperTooltipTypeMap<
export type PopperTooltipProps<
RootComponentType extends React.ElementType = PopperTooltipTypeMap['defaultComponent'],
-> = OverrideProps