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

185
Visualizações
Out of position react-responsive-carousel vertical text with line breaks

I'm using react-responsive-carousel for a vertical text-only carousel, but for some reason the slider is not positioning correctly and I can't figure out why.

When I break the lines it looks like this and I can't fix it:

enter image description here

This is the code for the above behavior, on top of a default create-react-app.

import './App.css';
import { Carousel } from "react-responsive-carousel";
import "react-responsive-carousel/lib/styles/carousel.min.css";

function App() {

  const phrases = [
    <p keu="1" className="text">FIRST PHRASE <br></br> SOME TEXT</p>,
    <p key="2" className="text">SECOND PHRASE <br></br> SOME MORE TEXT</p>
  ];

  return (
    <div className="App">
      <header className="App-header">
        <Carousel
          axis='axis'
          autoPlay='autoPlay'
          dynamicHeight={false}
          infiniteLoop={true}
          labels={false}
          showArrows={false}
          showStatus={false}
          showIndicators={false}
          showThumbs={false}
          width={400}
        >
          {phrases.map((item, id) => (
            <div key={id} style={{ backgroundColor: "brown" }}>
              {item}
            </div>
          ))}
        </Carousel>
      </header>
    </div>
  );
}

export default App;

Only extra dependency I'm using is yard add react-responsive-carousel


Update

Not a solution but we switched to react-slick which seems to have better support and it worked like a charm.

about 4 years ago · Juan Pablo Isaza
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