Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

270
Views
How to render options as a dropdown for the input?

I am currently working on a react component that filters some data and the component's primary use is that as a user types, it filters the data and outputs the data for the user to choose from. The data output is also clickable. Right now, my options are being listed like this:

picture 1

However, I would like this to be presented in a more dropdown fashion, instead of just listing them. For instance, like googles search results page:

picture 2

Here is my part of code that renders the options. The label part is what is presenting my options, but a more dropdown fashion would be nice that would be underneath or attached to the search bar. any advice would be helpful. Thanks a ton!

 return (
    <Fragment>
    <input type="text" placeholder="Enter Brewery Name" style={{ width: "40%", marginTop: "10px"}}
    className="search-box" onChange ={(debounce((e) => searchBreweries(e.target.value)))} />
        {searchBrews && searchBrews.map((brew) => {
        return (
            <ul>
                <label class="search" name="state" onClick={() => history.push({
                    pathname: '/BrewDetails', 
                    currentbrew: brew})}>
                        <option value="AL">{brew.name}</option>
                    </label>
                    
            </ul>
        )
    })
}
    </Fragment>

);

}

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!