Adding cursor: pointer to elements in Material UI
February 13th, 2024

Goal

We want to see the pointer cursor when hovering over a Material UI component.

Examples

<Typography sx={{ "&:hover": { cursor: "pointer" } }}> This is some text </Typography>
<Box p={2} border="1px solid #ccc" sx={{ "&:hover": { cursor: "pointer" } }}> <Typography>This is a box</Typography> </Box>

Notes

Make sure not to have a space between the & and :hover. That will only select hovered child components.

If you're trying to add cursor: pointer to an Icon, use an IconButton