@@ -45,7 +45,9 @@ export function ModalSection() {
4545 < >
4646 Built on Radix Dialog. Three sizes (< code > sm</ code > ,{ " " }
4747 < code > md</ code > , < code > lg</ code > ). Always uses an overlay and a
48- close button. Focus is trapped while open.
48+ close button. Focus is trapped while open. If content is taller
49+ than the viewport, the modal caps its height and scrolls
50+ vertically so the top and bottom stay reachable.
4951 </ >
5052 }
5153 whenToUse = {
@@ -99,6 +101,35 @@ export function ModalSection() {
99101 </ DialogFooter >
100102 </ DialogContent >
101103 </ Dialog >
104+
105+ < Dialog >
106+ < DialogTrigger asChild >
107+ < Button variant = "secondary" > Open tall</ Button >
108+ </ DialogTrigger >
109+ < DialogContent >
110+ < DialogHeader >
111+ < DialogTitle > Terms of service</ DialogTitle >
112+ < DialogDescription >
113+ When a modal is taller than the viewport, it scrolls
114+ vertically — try resizing the window shorter.
115+ </ DialogDescription >
116+ </ DialogHeader >
117+ < div className = "space-y-3" >
118+ { Array . from ( { length : 12 } ) . map ( ( _ , i ) => (
119+ < p key = { i } >
120+ Section { i + 1 } . Lorem ipsum dolor sit amet, consectetur
121+ adipiscing elit. Sed do eiusmod tempor incididunt ut
122+ labore et dolore magna aliqua. Ut enim ad minim veniam,
123+ quis nostrud exercitation ullamco laboris.
124+ </ p >
125+ ) ) }
126+ </ div >
127+ < DialogFooter >
128+ < Button variant = "ghost" > Decline</ Button >
129+ < Button > Accept</ Button >
130+ </ DialogFooter >
131+ </ DialogContent >
132+ </ Dialog >
102133 </ div >
103134 }
104135 code = { code }
@@ -108,6 +139,7 @@ export function ModalSection() {
108139 < li > Always include < code > <DialogTitle></ code > — required for screen readers.</ li >
109140 < li > Use < code > <DialogDescription></ code > for the supporting copy line.</ li >
110141 < li > Buttons live inside < code > <DialogFooter></ code > ; right-aligned on desktop, stacked on mobile.</ li >
142+ < li > Content taller than the viewport scrolls vertically inside the modal automatically.</ li >
111143 </ ul >
112144 }
113145 />
0 commit comments