Skip to content

[docs] Add rich Tooltip experiment#48648

Draft
siriwatknp wants to merge 2 commits into
mui:masterfrom
siriwatknp:exp/rich-tooltip
Draft

[docs] Add rich Tooltip experiment#48648
siriwatknp wants to merge 2 commits into
mui:masterfrom
siriwatknp:exp/rich-tooltip

Conversation

@siriwatknp

Copy link
Copy Markdown
Member

Summary

Experiment page demonstrating a rich Tooltip (dark header with title + keyboard shortcut chip, white body with description, arrow) built entirely with the existing Tooltip component — no new component.

Path: `docs/pages/experiments/rich-tooltip.tsx`
URL: `/experiments/rich-tooltip`

How

  • `title` accepts a `React.node`, so the header/shortcut/body layout is composed and passed in.
  • Styling via `slotProps.tooltip` (transparent, padding reset) + an inner wrapper that owns rounding/clipping/elevation.
  • `arrow` enabled; `slotProps.arrow` colors the arrow to match the dark header.

Notes

  • Rounding/clipping lives on an inner wrapper, not the tooltip slot — `overflow: hidden` on the slot would clip the arrow (the arrow renders as a child positioned outside the tooltip box).
  • Arrow color is fixed to the dark header; it does not adapt if a placement lands the arrow against the white body.

Showcase header + keyboard shortcut + description using the existing
Tooltip via composed title node and slot styling. No new component.
@code-infra-dashboard

code-infra-dashboard Bot commented Jun 10, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-48648--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

Refactor the Settings example to a custom tooltip slot component
(slots={tooltip}), forwarding className/style/ref, re-applying the
slot's placement margins, and coloring the arrow from the slot.
@zannager zannager added the docs Improvements or additions to the documentation. label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants