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

139
Views
react spring not working to let card slide down

I am new to react and I am trying to slide down my div element using react-spring. However the slide down effect is not working. I saw this in a tutorial and tried to implement it however its not working.

This is my code:

<Spring from={{ opacity: 0, marginTop: -500 }} to={{ opacity: 1, marginTop: 0 }}>
          {props => (
            <div style={props}>
              <div style={{ display: cost ? 'block' : 'none' }}>
              <Card className="calculation shadow">
                <CardBody>
                  <div style={{ borderTop: '2px solid #000 ', marginLeft: 20, marginRight: 20 
                   }}></div>
                  <Row style={{ float: 'right', marginBottom: '1rem' }}>
                    <span style={{ float: 'right' }}>
                      <FontAwesomeIcon icon={faClipboardList} onClick={this.handler} />
                    </span>
                  </Row>
                  <Row style={{ marginTop: '1rem', marginLeft: '3rem', marginBottom: '1rem' 
                        }}>
                    <h4>
                      <strong>Normal Freight:</strong> Rs{rate[destination]}/ton
                    </h4>
                  </Row>
                  <Row style={{ marginLeft: '3rem', marginBottom: '1rem' }}>
                    <h4>
                      <strong>Volume:</strong> {volume} tons
                    </h4>
                  </Row>
                  <Row style={{ marginLeft: '3rem', marginBottom: '1rem' }}>
                    <h4>
                      <strong>Special Freight:</strong> Rs{1.3 * rate[destination]}/ton
                    </h4>
                  </Row>
                  <Row style={{ marginLeft: '3rem', marginBottom: '1rem' }}>
                    <h4>
                      <strong>Delta Price:</strong> Rs{1.3 * rate[destination] - 
                       rate[destination]}{' '}
                    </h4>
                  </Row>
                  <Row style={{ marginLeft: '3rem', marginBottom: '1rem' }}>
                    <h4>
                      <strong>Cost Impact:</strong> Rs{(1.3 * rate[destination] - 
                       rate[destination]) * volume}
                    </h4>
                  </Row>
                  <div style={{ borderTop: '2px solid #000 ', marginLeft: 20, marginRight: 20 
                    }}></div>
                </CardBody>
              </Card>
              </div>
            </div>
          )}
        </Spring>

How do I make it work so that the div component slides down on clicking a button. Please help

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!