Skip to content

Commit

Permalink
Border layout sticky example update (#4485)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fercas123 authored Dec 12, 2024
1 parent dedbade commit d659b58
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion site/docs/components/border-layout/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Use the `verticalAlignment` and `horizontalAlignment` properties of the border i

Use the `sticky` prop of the border item wrapper to define a region as sticky. When you set it to `true`, content in surrounding regions will scroll beneath a `sticky` Border Item.

This is particularly useful if you require a header, (in the North region) or side navigation (in the West region) to remain visible at all times.
This is particularly useful if you require a region to remain visible at all times. For more information, see [CSS `position: sticky`](https://developer.mozilla.org/en-US/docs/Web/CSS/position#sticky).

</LivePreview>

Expand Down
2 changes: 0 additions & 2 deletions site/src/examples/border-layout/StickyPositioning.module.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
.borderLayout {
height: 200px;
width: 260px;
}

.center {
flex-direction: column;
overflow: auto;
justify-content: unset;
text-align: center;
}
9 changes: 5 additions & 4 deletions site/src/examples/border-layout/StickyPositioning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ import stickyPositioningStyles from "./StickyPositioning.module.css";
import styles from "./index.module.css";

export const StickyPositioning = (): ReactElement => (
<BorderLayout className={stickyPositioningStyles.borderLayout}>
<BorderLayout
className={stickyPositioningStyles.borderLayout}
style={{ height: "200px" }}
>
<BorderItem position="north" sticky className={styles.borderItem}>
North
</BorderItem>
<BorderItem position="west" className={styles.borderItem}>
West
</BorderItem>
<BorderItem
position="center"
className={clsx(styles.borderItem, stickyPositioningStyles.center)}
style={{ overflow: "auto" }}
>
<p>Center</p>
<p>
Expand Down

0 comments on commit d659b58

Please sign in to comment.