-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[docs] Improve the Select docs #37279
Conversation
Netlify deploy previewBundle size report |
|
||
### Controlled select | ||
|
||
Select can be used as an uncontrolled or controlled component: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we've learned with feedback in the X docs, we should add a callout here to briefly explain this concept. We could copy the text from this PR: mui/mui-x#8926
{{"demo": "UnstyledSelectControlled.js", "defaultCodeOpen": false}} | ||
|
||
To set the value of the controlled Select, use the `value` prop. | ||
In the other case the `defaultValue` can be used to set the initial value of the component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is meant by "In the other case" here? What is the other case—an uncontrolled Select?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I rephrased it a bit.
Co-authored-by: Sam Sycamore <[email protected]> Signed-off-by: Michał Dudak <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good enough as is but here's one last round of polishing! 😁
Co-authored-by: Sam Sycamore <[email protected]> Signed-off-by: Michał Dudak <[email protected]>
A few improvements of the Base UI's Select docs.