Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

239
Visualizações
How to make two dropdowns in one line in react?

I don't know what wrong I am doing but these two dropdowns are not rendering in one line, please someone help me to render them in one line

import React from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';
import Select from 'react-select';

function NavForRest() {

    const langOptions = [
                    { value: 'EN', label: 'EN' },
                    { value: 'HINDI', label: 'HINDI' },
                    { value: 'SANSKRIT', label: 'SANSKRIT' }
    ]
    
    const currencyOptions = [
                    { value: 'INR', label: 'INR' },
                    { value: 'INR', label: 'INR' },
                    { value: 'AUD', label: 'AUD' }
                    ]

    return (
            <div className="d-flex flex-row justify-content-between w-80 mt-0 mb-0" style={{"width":"80%", "margin":"auto"}}>

                <div style={{"display":"inline"}}>
                    <span>
                         <Select options={langOptions} />
                    </span>
                    <span>
                        <Select options={currencyOptions} />
                    </span>
                </div>
                </div>
    )
}

export default NavForRest;

Here is the output

output image

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

1) You can just use flexbox here and style in a single line as

This works because by default flex-direction is row so you just have add display: flex and It will arrange in single line

Live Demo

Codesandbox Demo

<div style={{ display: "flex" }}>

EXTRA INFORMATION: You can also use gap property to add some space in between flex-items

<div style={{ display: "flex", gap: "1rem" }}>

2) Since you are also using bootstrap here then you just have to add d-flex class and this alone will do work.

about 4 years ago · Juan Pablo Isaza Relatório

0

use display flex

<div style={{"display":"flex"}}>
            <span>
                 <Select options={langOptions} />
            </span>
            <span>
                <Select options={currencyOptions} />
            </span>
        </div>
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda