DEV Community

Md Wahiduzzaman Emon
Md Wahiduzzaman Emon

Posted on

Answer: Best way to dim/disable a div in Material-UI?

opacity: contidion ? 0.5 : 1,
pointerEvents: contidion ? "none" : "auto",

use sx props or style in material to disable

<Box sx={{ opacity: <contidion> ? 0.5 : 1,pointerEvents:<contidion> ? "none" : "auto"}}/>

you can use this way any kind of div/tag in html

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay