Skip to main content

React MUI Tooltip SEO

Boost your SEO game with this quick and simple code tweak!

Material UI tooltips are handy for displaying important information, but did you know they can also impact your site's SEO? Here's a brief code snippet to make sure your tooltips stay in the game.

import { IconButton, Tooltip } from "@mui/material";
import HelpOutlineIcon from "@mui/icons-material/HelpOutline";

<Tooltip
title="important content"
slotProps={{
popper: { keepMounted: true },
}}
>
<IconButton aria-label="help">
<HelpOutlineIcon />
</IconButton>
</Tooltip>

This snippet ensures that the Material UI tooltip stays mounted in the DOM, making it accessible for search engine optimization (SEO). By using this code, the tooltip remains present and accounted for not only during user interactions but also on the crucial initial page load.