@@ -4,11 +4,13 @@ import {
44 Code ,
55 ExternalLink ,
66 Header ,
7- Input
7+ Input ,
8+ Tooltip
89} from "react-lib-tools" ;
910import { html as DropShadowHTML } from "../../public/generated/examples/DropShadow.json" ;
1011import { html as FocusOutlineHTML } from "../../public/generated/examples/FocusOutline.json" ;
1112import { html as GroupAndPanelElementsHTML } from "../../public/generated/examples/GroupAndPanelElements.json" ;
13+ import { html as TooltipHTML } from "../../public/generated/examples/Tooltip.json" ;
1214import { Group } from "../components/styled-panels/Group" ;
1315import { Panel } from "../components/styled-panels/Panel" ;
1416
@@ -19,16 +21,17 @@ export default function OverflowRoute() {
1921 < Box direction = "column" gap = { 4 } >
2022 < Header section = "Examples" title = "Overflow" />
2123 < div >
22- Groups and panels use the{ " " }
24+ Groups and Panels set the{ " " }
2325 < ExternalLink href = "https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/overflow" >
2426 overflow
2527 </ ExternalLink > { " " }
26- styles shown below.
28+ styles shown below:
2729 </ div >
2830 < Code html = { GroupAndPanelElementsHTML } />
2931 < div >
30- This combination of styles allows overflow content to be scrolled while
31- also supporting visual styles like shadows.
32+ This combination of styles allows overflow content to be scrollable
33+ while also allowing Panels to have visual styles like shadows or
34+ outlines.
3235 </ div >
3336 < div >
3437 For example, this group of panels demonstrate drop-shadow style.
@@ -80,6 +83,30 @@ export default function OverflowRoute() {
8083 The panel sets a higher z-index on < code > focus-within</ code > to avoid
8184 clipping issues.
8285 </ Callout >
86+ < div >
87+ Styles that affect the outer panel element (e.g. shadows, outlines) work
88+ without any customizations. Things like tooltips or popovers that are
89+ rendered < em > inside</ em > of the panel will be clipped by the{ " " }
90+ < code > overflow:auto</ code > style. Because of this it's recommended to
91+ use{ " " }
92+ < ExternalLink href = "https://react.dev/reference/react-dom/createPortal" >
93+ portals
94+ </ ExternalLink > { " " }
95+ for these. However you can override the default style as shown below.
96+ </ div >
97+ < Code html = { TooltipHTML } />
98+ < Group >
99+ < Panel className = "overflow-visible!" minSize = { 100 } >
100+ < Tooltip content = "This is the left panel" positions = { [ "top" ] } >
101+ left
102+ </ Tooltip >
103+ </ Panel >
104+ < Panel className = "overflow-visible!" minSize = { 100 } >
105+ < Tooltip content = "This is the right panel" positions = { [ "top" ] } >
106+ right
107+ </ Tooltip >
108+ </ Panel >
109+ </ Group >
83110 </ Box >
84111 ) ;
85112}
0 commit comments