Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

277
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda