SelectDropdown: Add Component
See original GitHub issueFor integration with Gutenberg, we may need to replace the current FontSizePicker component from @wordpress/components (as it related to Typography Tools in Global Styles).
As such, we’ll need some sort of custom select component:

I’m not a fan of the name CustomSelect
(from @wordpress/components
).
Ultimately, we can go with that if it’s the best option.
I feel like either SelectDropdown
or SelectMenu
is a better description.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
How to create a Dropdown select component in React?
Step 1: Analyze the dropdown component · Step 2: Create a dropdown input UI · Step 3: Create a dropdown menu UI ·...
Read more >How to add a new item in a drop down list of select component ...
I have a dropdown component that uses the Select component from react-select dependency. I have added a button in the dropdown's option list ......
Read more >Customize a reusable React dropdown menu component
A dropdown component, which is a custom version of the dropdown select option with extended styles, sorts and filters content on webpages.
Read more >react-dropdown-select - npm
Start using react-dropdown-select in your project by running `npm i ... If create set to true, this will be the label of the...
Read more >Components - React Select
A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A bit late here! 😅
That’s a great question. I’ve seen people using
Menu
for that in the past: https://codesandbox.io/s/gaudi-0bp08?file=/src/components/Listbox/Listbox.tsxBut I think Combobox is the best base for that, although it would still require a lot of work to make a select completely accessible with that.
Anyway, the best resources I know for accessible select components are these articles by Sarah Higley:
Update: We did it! ✨
In addition to reusing 99% of existing components and styles for
SelectDropdown
, I also have Portaling + Popper working.Check out this demo: https://d.pr/v/RIRg1p
In it, you can see the Dropdown repositioning itself to the left/right if there’s a chance it may be “cut off” from view in the browser (this is thanks to the positioning engine that is popper.js). The content is also Portal’ed. So it doesn’t absorb lineHeight/fontSize styles from the inline text content.