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

296
Views
how do you add a option were when you hover over a floating action button it changes the color like a filter

I never used a <Fab /> before but I'm confused on how to add a hover option that changes the buttons color. So far i have this:

js:

<Fab variant="extended" className="sidebar__tweet" fullWidth>
  <TwitterIcon className= 'sidebar__twitterIcon2' sx={{ mr: 1 }} />
  Tweet
</Fab>

css:

sidebar__tweet:
.sidebar__tweet {
        background-color: var(--twitter-color) !important;
        border: none !important;
        color: #444444 !important;
        font-weight: 900 !important;
        text-transform: inherit  !important;
        border-radius:  30px !important;
        height: 50px !important;
        margin-top: 20px !important;
    }
sidebar__TweetIcon2:
    .sidebar__twitterIcon2 {
        color: #444444;
    }

if i add a new css function that changes the hover color it errases the other styleings of the button and goes back to default

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

<Fab /> comes with hover color based on the color prop.

If you want to override the color, you can use the sx prop.

<Fab
  color="primary"
  aria-label="add"
  sx={{
    border: '3px solid orange',
    ":hover": {
      background: "linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)"
    }
  }}
>
  <TwitterIcon sx={{ mr: 1 }} />
</Fab>

https://codesandbox.io/s/fab-custom-hover-effect-gqhrt?file=/demo.js

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