Skip to content

Conversation

@SaadArqam
Copy link

feat(tooltip): add hideArrow prop to TooltipContent

Description

This pull request adds an optional hideArrow prop to the TooltipContent component, allowing developers to hide the tooltip arrow when needed.
This enhances flexibility for minimalist layouts, prevents visual overlap with surrounding UI elements, and aligns the Tooltip API with capabilities found in other UI libraries.


Changes Made

  • Extended TooltipContentProps to include a new optional boolean prop hideArrow.
  • Updated TooltipContent to accept the hideArrow prop with a default value of false to maintain backward compatibility.
  • Updated sideOffset behavior:
    • If hideArrow is true and no custom sideOffset is provided, default becomes 4.
    • If the arrow is visible, default remains 0.
    • Custom sideOffset values always take precedence.
  • Conditionally render TooltipPrimitive.Arrow only when hideArrow is false.
  • Ensured that all existing tooltip functionality, styling, and behaviors remain intact.
  • Verified that the registry builds successfully (pnpm registry:build) and the component works across all style variants.

Motivation

  • Support cleaner, minimalist UI designs.
  • Prevent tooltip arrows from overlapping adjacent UI components.
  • Provide greater control to developers and designers.
  • Align with similar features available in Radix, Material UI, and other popular UI libraries.

Related Issue


Testing Performed

  • Verified default tooltip behavior (arrow visible).
  • Verified behavior when hideArrow is enabled (arrow hidden).
  • Verified behavior with custom sideOffset.
  • Confirmed rendering and animations across all tooltip sides.
  • No regressions observed in existing tooltip usage.

@vercel
Copy link

vercel bot commented Nov 16, 2025

Someone is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant