React

Scroll Fog

Acts as a hint that visually informs users that there is additional content in a scrollable area.

Available since@seed-design/react@1.1.3, @seed-design/css@1.1.3

This Scroll Fog component is a component for simpler scroll hints only, rather than Chakra ScrollArea, Radix ScrollArea, or Base UI ScrollArea. It may be expanded later if additional scrollbar functionality is needed.

Usage

import { ScrollFog } from "@seed-design/react";
<div style={{ height: "300px" }}>
  <ScrollFog>
    {/* Scrollable content */}
    <div style={{ padding: "20px 0" }}>Content</div>
  </ScrollFog>
</div>

Props

Scroll Fog

Prop

Type

Examples

Padding

ScrollFog always displays the fog effect, so sufficient padding is required in the specified direction.

  • Minimum padding: Must maintain 20px.
  • Vertical scroll taking full screen: Recommended 80px bottom, 20px top padding
  • Horizontal scroll: Recommended 20px left/right padding
// Vertical scroll - need top/bottom padding
<ScrollFog placement={["top", "bottom"]}>
  <div style={{ padding: "20px 0 80px 0" }}>Content</div>
</ScrollFog>

// Horizontal scroll - need left/right padding
<ScrollFog placement={["left", "right"]}>
  <div style={{ padding: "0 20px" }}>Content</div>
</ScrollFog>

Horizontal Scroll

When horizontal scrolling is needed, you can apply left/right fog effects using placement={["left", "right"]}. Provide 20px padding on left and right to ensure content is not cut off.

Size

You can adjust the scroll effect size using the size attribute. You can adjust the size for each direction using the sizes attribute.

All Directions

When 2D scrolling is needed, you can apply fog effects in all directions using placement={["top", "bottom", "left", "right"]}.

Hide Scrollbar

You can hide the scrollbar using the hideScrollBar attribute.

Table of contents