https://kotlinlang.org logo
#javascript
Title
# javascript
c

Cheick Kante

07/29/2022, 12:49 AM
HI I'm using MUI in trying to change the background-color for the Paper component in Dialog through PaperProps but my app crahes when I do
Copy code
Dialog { 
 PaperComponent = FC { //this : ChildrenBuilder it: PaperProps
    <http://it.sx|it.sx> {
        fontSize = FontSize.small
        backgroundColor = Color("transparent")
    }

 }
}
I have also tried this but doesn't do anything
Copy code
Dialog { 
 PaperComponent = FC { //this : ChildrenBuilder it: PaperProps
        it.asDynamic()["background-color"] = "transparent"
        it.asDynamic()["font-size"] = "small"
  }
}
Does anyone
t

turansky

07/29/2022, 8:47 AM
Copy code
Dialog { 
   PaperComponent = MyPaper
}

val MyPaper = FC<PaperProps> { props ->
    Paper {
        +props

        sx {
            fontSize = FontSize.small
            backgroundColor = NamedColor.transparent
        }
    }
 }
c

Cheick Kante

07/30/2022, 9:21 PM
Solved it, thanks Victor !
2 Views