diff --git a/.changeset/lucky-gifts-rule.md b/.changeset/lucky-gifts-rule.md new file mode 100644 index 00000000000..35852362cac --- /dev/null +++ b/.changeset/lucky-gifts-rule.md @@ -0,0 +1,5 @@ +--- +'@primer/react': minor +--- + +Adjusts position of children within `PageLayout.Pane` to live above adjustable resize form. diff --git a/docs/content/SplitPageLayout.mdx b/docs/content/SplitPageLayout.mdx index 54c3922cf6f..d9b500ae643 100644 --- a/docs/content/SplitPageLayout.mdx +++ b/docs/content/SplitPageLayout.mdx @@ -237,6 +237,22 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ``` +### With heading + +```jsx live drafts + + + + Pane Heading + + + + + + + +``` + ### With non-sticky pane ```jsx live drafts diff --git a/src/PageLayout/PageLayout.features.stories.tsx b/src/PageLayout/PageLayout.features.stories.tsx index 9f2ceebed5f..25c704eb2d8 100644 --- a/src/PageLayout/PageLayout.features.stories.tsx +++ b/src/PageLayout/PageLayout.features.stories.tsx @@ -357,3 +357,23 @@ export const CustomPaneWidths: Story = () => ( ) + +export const WithCustomPaneHeading: Story = () => ( + + + + + + + Pane Heading + + + + + + + + + + +) diff --git a/src/PageLayout/PageLayout.tsx b/src/PageLayout/PageLayout.tsx index 8b5ce1a1f27..e516be2189f 100644 --- a/src/PageLayout/PageLayout.tsx +++ b/src/PageLayout/PageLayout.tsx @@ -797,6 +797,7 @@ const Pane = React.forwardRef + {children} {resizable && ( // eslint-disable-next-line github/a11y-no-visually-hidden-interactive-element @@ -823,7 +824,6 @@ const Pane = React.forwardRef )} - {children} ) diff --git a/src/SplitPageLayout/SplitPageLayout.tsx b/src/SplitPageLayout/SplitPageLayout.tsx index a5ce5f6dbd0..9be57f08acb 100644 --- a/src/SplitPageLayout/SplitPageLayout.tsx +++ b/src/SplitPageLayout/SplitPageLayout.tsx @@ -74,7 +74,15 @@ export const Pane: React.FC> = divider = 'line', ...props }) => { - return + return ( + + ) } Pane.displayName = 'SplitPageLayout.Pane'