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

176
Views
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
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!