···2222import { SizeContext } from "../context";
2323import { animationDuration } from "../theme/animations.stylex";
2424import { primaryColor } from "../theme/color.stylex";
2525-import { mediaQueries } from "../theme/media-queries.stylex";
2625import { radius } from "../theme/radius.stylex";
2726import { ui } from "../theme/semantic-color.stylex";
2827import { spacing } from "../theme/spacing.stylex";
+7
apps/docs/src/docs/components/overlays/dialog.mdx
···77import { Example } from "../../../lib/Example";
88import { Basic } from "../../../examples/dialog/basic";
99import { DialogForm } from "../../../examples/dialog/form";
1010+import { LongContentDialog } from "../../../examples/dialog/long-content";
1011import { DialogSizes } from "../../../examples/dialog/sizes";
11121213<Example src={Basic} />
1414+1515+### Long Content
1616+1717+Dialogs can handle long-form content inside the body while keeping the surrounding chrome usable.
1818+1919+<Example src={LongContentDialog} />
13201421## Installation
1522
···11+import { Button } from "@/components/button";
22+import {
33+ Dialog,
44+ DialogBody,
55+ DialogFooter,
66+ DialogHeader,
77+} from "@/components/dialog";
88+import { Flex } from "@/components/flex";
99+import { Body } from "@/components/typography";
1010+1111+const paragraphs = [
1212+ "This example is intentionally long so you can verify that the dialog body scrolls independently while the header and footer remain easy to reach.",
1313+ "Longer dialogs are useful for policies, onboarding steps, release notes, audit details, or any workflow where users need to review a lot of content before taking action.",
1414+ "Keeping the content inside the dialog body also prevents the overall page from jumping unexpectedly when the modal opens on smaller screens.",
1515+ "The header stays visible so the user always knows which task they are in, and the footer stays close at hand so the primary and secondary actions remain accessible.",
1616+ "If your dialog contains a form, this same pattern helps users scroll through guidance, field groups, and validation messages without losing the submit actions.",
1717+ "You can also combine long-form text with lists, media, tables, or sections as long as the core interaction still fits comfortably inside a modal experience.",
1818+ "When content grows beyond a simple confirmation, it is usually a good idea to keep the title concise and let the body carry the detailed explanation.",
1919+ "For especially dense content, consider splitting the experience into sections or steps so the modal does not feel overwhelming even when it needs to be comprehensive.",
2020+ "This sample keeps the copy simple, but the important part is that the content is long enough to exercise overflow behavior in a realistic layout.",
2121+ "After reviewing the content, the user can cancel or continue without needing to scroll all the way back to the top of the dialog.",
2222+];
2323+2424+export function LongContentDialog() {
2525+ return (
2626+ <Dialog trigger={<Button>Open Long Content Dialog</Button>}>
2727+ <DialogHeader>Review Details</DialogHeader>
2828+ <DialogBody>
2929+ <Flex direction="column" gap="4">
3030+ {paragraphs.map((paragraph) => (
3131+ <Body key={paragraph}>{paragraph}</Body>
3232+ ))}
3333+ </Flex>
3434+ </DialogBody>
3535+ <DialogFooter>
3636+ <Button variant="secondary">Close</Button>
3737+ <Button>Continue</Button>
3838+ </DialogFooter>
3939+ </Dialog>
4040+ );
4141+}