Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui][InputLabel] Changed size prop value from normal to medium #45235

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

perkrlsn
Copy link

@perkrlsn perkrlsn commented Feb 7, 2025

From what I can tell the InputLabel is the only component with a 'small' | 'normal' size prop. Looking through the rest of components (albeit with a very rudimentary search) the standard seems to be 'small' | 'medium'.

This PR updates the propery for the InputLabel to match other components.

image

image

@ZeeshanTamboli ZeeshanTamboli changed the title [InputLabel] changed size prop from normal to medium [InputLabel] Changed size prop value from normal to medium Feb 9, 2025
@ZeeshanTamboli ZeeshanTamboli changed the title [InputLabel] Changed size prop value from normal to medium [material-ui][InputLabel] Changed size prop value from normal to medium Feb 9, 2025
@ZeeshanTamboli ZeeshanTamboli added package: material-ui Specific to @mui/material component: FormControl The React component breaking change labels Feb 9, 2025
@mui-bot
Copy link

mui-bot commented Feb 9, 2025

@ZeeshanTamboli ZeeshanTamboli added this to the Material UI v7 milestone Feb 9, 2025
@ZeeshanTamboli
Copy link
Member

@DiegoAndai @aarongarciah Should we include this breaking change in v7? A similar PR was opened before (#36188). It’s just a prop value change for consistency.

I've also added it to the v7 upgrade guide: https://deploy-preview-45235--material-ui.netlify.app/material-ui/migration/upgrade-to-v7/

What do you think? Worth including?

@aarongarciah
Copy link
Member

@ZeeshanTamboli +1 for being consistent.

Comment on lines +70 to +79
The `size` prop for `InputLabel` now follows the standard naming convention used across Material UI. `'normal'` has been replaced with `'medium'` for consistency.

If you were using `size="normal"`, update it to `size="medium"`:

```diff
-<InputLabel size="normal">Label</InputLabel>
+<InputLabel size="medium">Label</InputLabel>
```

This aligns `InputLabel` with other components like `Button` and `TextField`, which use `'small' | 'medium'`. The default behavior remains unchanged, so no updates are needed unless you explicitly set `size="normal"`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The `size` prop for `InputLabel` now follows the standard naming convention used across Material UI. `'normal'` has been replaced with `'medium'` for consistency.
If you were using `size="normal"`, update it to `size="medium"`:
```diff
-<InputLabel size="normal">Label</InputLabel>
+<InputLabel size="medium">Label</InputLabel>
```
This aligns `InputLabel` with other components like `Button` and `TextField`, which use `'small' | 'medium'`. The default behavior remains unchanged, so no updates are needed unless you explicitly set `size="normal"`.
The `size` prop for `InputLabel` now follows the standard naming convention used across other components like `Button` and `TextField`. `'normal'` has been replaced with `'medium'` for consistency.
If you were using `size="normal"`, update it to `size="medium"`:
```diff
-<InputLabel size="normal">Label</InputLabel>
+<InputLabel size="medium">Label</InputLabel>

The default behavior remains unchanged, so no updates are needed unless you explicitly set size="normal".

@aarongarciah
Copy link
Member

@ZeeshanTamboli we should add a codemod, too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants