Wait until you need it

Recently I was working on a creating some form components in React and Next.js for one of my subscription engineering clients, helping get a bit consistency across their UI components.
After building out a <select> component based on its use across their existing site, the client asked (I’m paraphrasing)…
Could we add support for <optgroup> if an item has an array instead of a string as its property value?


This content originally appeared on Go Make Things and was authored by Go Make Things

Recently I was working on a creating some form components in React and Next.js for one of my subscription engineering clients, helping get a bit consistency across their UI components.

After building out a <select> component based on its use across their existing site, the client asked (I’m paraphrasing)…

Could we add support for <optgroup> if an item has an array instead of a string as its property value?

It’s not an unreasonable ask. It would make the component a lot more flexible.

But the existing UI doesn’t use that pattern anywhere currently. Maybe it should. Maybe it shouldn’t.

But that’s the conversation I’d want to have first.

Are there places in the UI where <select> menus are unwieldy because they have too many options? If so, should we use <optgroup> elements to break them into sections, or is there a better way to handle that UI that’s simpler for the user?

Optimizing your code is great!

Optimizing it for an imagined future need that may never come to be, though, just results in code that’s more complex, harder to read, harder to use, and harder to maintain.

Need help with your project? Get in touch.

Like this? A Lean Web Club membership is the best way to support my work and help me create more free content.


This content originally appeared on Go Make Things and was authored by Go Make Things


Print Share Comment Cite Upload Translate Updates
APA

Go Make Things | Sciencx (2025-08-27T14:30:00+00:00) Wait until you need it. Retrieved from https://www.scien.cx/2025/08/27/wait-until-you-need-it/

MLA
" » Wait until you need it." Go Make Things | Sciencx - Wednesday August 27, 2025, https://www.scien.cx/2025/08/27/wait-until-you-need-it/
HARVARD
Go Make Things | Sciencx Wednesday August 27, 2025 » Wait until you need it., viewed ,<https://www.scien.cx/2025/08/27/wait-until-you-need-it/>
VANCOUVER
Go Make Things | Sciencx - » Wait until you need it. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/08/27/wait-until-you-need-it/
CHICAGO
" » Wait until you need it." Go Make Things | Sciencx - Accessed . https://www.scien.cx/2025/08/27/wait-until-you-need-it/
IEEE
" » Wait until you need it." Go Make Things | Sciencx [Online]. Available: https://www.scien.cx/2025/08/27/wait-until-you-need-it/. [Accessed: ]
rf:citation
» Wait until you need it | Go Make Things | Sciencx | https://www.scien.cx/2025/08/27/wait-until-you-need-it/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.