Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(docsite): a wide example keeps its leading edge in the preview's scroll area (#9444)

Cindy Zhang2d1900cf860a
diff --git a/apps/docsite/src/components/component-detail/ExampleBlock.tsx b/apps/docsite/src/components/component-detail/ExampleBlock.tsx
index 23414ce48d..083bc5fc9a 100644
--- a/apps/docsite/src/components/component-detail/ExampleBlock.tsx
+++ b/apps/docsite/src/components/component-detail/ExampleBlock.tsx
@@ -136,7 +136,9 @@ function LivePreview({
minHeight: 200,
display: 'flex',
alignItems: 'center',
- justifyContent: 'center',
+ // Center an example that fits, but keep the leading edge of a wider
+ // one in the scroll area, where a reader can scroll to it.
+ justifyContent: 'safe center',
}}
{...previewNavigationProps}>
<ExampleLayoutRoot>