From 159e94b231fdc646e66331939ba3d2ae2c9bd873 Mon Sep 17 00:00:00 2001 From: Daniel Barion Date: Wed, 4 Nov 2026 09:04:58 -0300 Subject: [PATCH] docs: set tooltip padding on the content wrapper The default padding moved off the tooltip root in 5.30.1 and v6. className still lands on the root, so the styling examples and the v5 to v6 changelog now target .react-tooltip-content-wrapper. --- docs/docs/examples/styling.mdx | 6 ++++-- docs/docs/upgrade-guide/changelog-v5-v6.md | 7 +++++++ docs/src/css/custom.css | 4 ++-- docs/versioned_docs/version-5.x/examples/styling.mdx | 6 ++++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/docs/examples/styling.mdx b/docs/docs/examples/styling.mdx index 0d3e5a2b..81c79598 100644 --- a/docs/docs/examples/styling.mdx +++ b/docs/docs/examples/styling.mdx @@ -348,13 +348,15 @@ import { Tooltip } from 'react-tooltip' ### Changing the padding +The default `padding: 8px 16px` is on `.react-tooltip-content-wrapper`. `className` is applied to the tooltip root, so a `padding` rule there is added around the content instead of replacing the default. Set padding on the content wrapper. + #### Removing padding ```jsx import { Tooltip } from 'react-tooltip' @@ -383,7 +385,7 @@ import { Tooltip } from 'react-tooltip' import { Tooltip } from 'react-tooltip' diff --git a/docs/docs/upgrade-guide/changelog-v5-v6.md b/docs/docs/upgrade-guide/changelog-v5-v6.md index 7d4cd92c..78f99e17 100644 --- a/docs/docs/upgrade-guide/changelog-v5-v6.md +++ b/docs/docs/upgrade-guide/changelog-v5-v6.md @@ -21,6 +21,13 @@ V6 keeps the core tooltip behavior from V5, but updates the implementation and A - `data-tooltip-html` was removed - `html` prop was removed - Raw HTML string examples should now be implemented with `children` or `render` +- Default padding (`8px 16px`) is on `.react-tooltip-content-wrapper`, not the root `.react-tooltip`. This also shipped in 5.30.1. A `padding` rule on `className` is added around the content instead of replacing the default. Set it on the content wrapper: + +```css +.my-tooltip .react-tooltip-content-wrapper { + padding: 0; +} +``` ## New And Updated Capabilities diff --git a/docs/src/css/custom.css b/docs/src/css/custom.css index 5db67ee6..90a1a67a 100644 --- a/docs/src/css/custom.css +++ b/docs/src/css/custom.css @@ -86,11 +86,11 @@ border-radius: 50%; } -.example-container .example-no-padding { +.example-container .example-no-padding .react-tooltip-content-wrapper { padding: 0; } -.example-container .example-padding { +.example-container .example-padding .react-tooltip-content-wrapper { padding: 48px; } diff --git a/docs/versioned_docs/version-5.x/examples/styling.mdx b/docs/versioned_docs/version-5.x/examples/styling.mdx index 12c70033..3b71fb67 100644 --- a/docs/versioned_docs/version-5.x/examples/styling.mdx +++ b/docs/versioned_docs/version-5.x/examples/styling.mdx @@ -348,13 +348,15 @@ import { Tooltip } from 'react-tooltip' ### Changing the padding +The default `padding: 8px 16px` is on `.react-tooltip-content-wrapper`. `className` is applied to the tooltip root, so a `padding` rule there is added around the content instead of replacing the default. Set padding on the content wrapper. + #### Removing padding ```jsx import { Tooltip } from 'react-tooltip' @@ -383,7 +385,7 @@ import { Tooltip } from 'react-tooltip' import { Tooltip } from 'react-tooltip'