-
-
Notifications
You must be signed in to change notification settings - Fork 352
[docs][select] Remove placeholders #3580
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][select] Remove placeholders #3580
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Two arguments for "placeholders" when there's an empty state (e.g. country select which can't have a default value, unlike the font example)
In a long form, users often scan for empty fields to see what is left to fill in. If a select already has a value filled in (the default option), it might look finished. A placeholder with a muted text color (like gray) clearly signals "This field is incomplete"
Text inputs typically start empty with a placeholder, but select inputs that start pre-filled break this consistency, forcing the user to process two different types of "unfilled" states I agree that in a typical web app UI, all selects are prefilled with some value, but in a traditional "form", selects start off empty. For example, how would you model a "Select country" select widget without a placeholder? Which btw the Combobox has as a demo, and would need updating here too. I would say at the very least, we need some kind of section documenting placeholders and recommended guidelines for them.
We should update the demos to use them because the demos contradict the recommendation in Usage guidelines and every other demo has a |
|
The idea is to not promote placeholders from the get go. The thing is, when a Select is properly labelled, there aren't many use cases for placeholders.
Yeah, I see this pretty often. But again, if the Select is properly labelled, what value is the placeholder adding if the user is picking from a set of predefined values? Isn't an empty Select equally signaling "This field is incomplete"?
But a Select can start empty, right? No need for it to be prefilled. It's true that sometimes seeing placeholders in all inputs (text, select, etc.) it's visually appealing, and in rare cases they can help. For example, the month and year placeholders in this screenshot from shadcn helps know the format you need to type if you're using typeahead:
I didn't mean all Selects should be prefilled. The only reason to prefill the demos in this PR was because there's no labels. They could be empty initially.
If that demo had a label (as it should), what would be the added value of a placeholder? If the intention is to be able to "empty" the value, shouldn't a specific option be added? e.g. "None", instead of using the placeholder as label? If the field was required, the "None" option could be obviated, of course.
A section on how to deal with placeholders would be nice e.g. recommending not using placeholders as a substitute for labels, etc. I'm pretty sure users will keep using placeholders, and there are valid use cases, but maybe not using them in all demos helps set a better tone.
👍 |
Colm had a thread about this - an empty button with no label looks weird when it's not an input (at least imo 😅). I haven't seen that anywhere on the web and it looks confusing. I think all buttons need to have something inside of them, regardless if they're labeled explicitly or not. https://x.com/colmtuite/status/1942903716602102018
The main issue is a |
|
This will be replaced by #3604 |

Select placeholders don't add value and are not required in the vast majority of use cases. This PR removes all placeholders from Select demos so we don't promote its usage.
nullvalue have been removed and adefaultValuehas been added instead.defaultValue.Updated demos:
Note: Ideally all Selects should have a proper label, but I assume we don't want to add noise when showcasing individual components demos.