Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transparent AppBar in material-ui (React)

Tags:

material-ui

Is there a way to change the background property of my material-ui AppBar component to transparent without having to actually change the CSS?

I've tried the opacity property, but that reduces the opacity of everything within the component it seems.

Below is an example of what I mean on Stripe's website.

enter image description here

like image 832
Matt Hough Avatar asked May 01 '18 13:05

Matt Hough


People also ask

How do I fix my AppBar?

Just use position="sticky" instead of position="fixed" for your AppBar. Thanks! Works perfectly.


1 Answers

You can change its background color to transparent and remove the box-shadow this way:

<AppBar position="static"  style={{ background: 'transparent', boxShadow: 'none'}}>
like image 149
Aniko Litvanyi Avatar answered Sep 17 '22 13:09

Aniko Litvanyi