Lynx

Scroll Fog

Serves as a hint to visually inform users that additional content exists in a scrollable area.

Available since@seed-design/lynx-react@1.0.0
Loading Lynx example…

Scroll Fog is a component for simple scroll hints rather than a complete Scroll Area. It displays a separate non-interactive mask layer using Rootage's gradient.fade-mask over the scroll area.

Installation

npm install @seed-design/lynx-react

Lynx's ScrollFog is provided directly from the @seed-design/lynx-react package without a Registry snippet or Recipe.

Usage

ScrollFog supports placement for any direction, common size, direction-specific sizes, and hideScrollBar just like the React version. You can specify top, bottom, left, and right in any combination for placement. The Fog layer does not intercept touch input, so you can scroll or manipulate the content.

import { ScrollFog } from "@seed-design/lynx-react";

export function App() {
  return (
    <view style={{ height: "300px" }}>
      <ScrollFog placement={["top", "bottom"]}>
        <view style={{ padding: "20px 0 80px" }}>
          <text>Content to scroll</text>
        </view>
      </ScrollFog>
    </view>
  );
}

Props

Scroll Fog

Prop

Type

children?React.ReactNode
className?string | undefined
style?string | CSSProperties | undefined

Examples

Padding

ScrollFog always displays the fog effect, so sufficient padding in the specified directions is needed.

  • Minimum padding: Must maintain 20px.
  • Vertical scrolling occupying full screen: Recommend 80px bottom and 20px top padding.
  • Horizontal scrolling: Recommend 20px left and right padding.
// Vertical scroll - top/bottom padding needed
<ScrollFog placement={["top", "bottom"]}>
  <view style={{ padding: "20px 0 80px" }}>...</view>
</ScrollFog>

// Horizontal scroll - left/right padding needed
<ScrollFog placement={["left", "right"]}>
  <view style={{ padding: "0 20px" }}>...</view>
</ScrollFog>

Horizontal Scroll

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

Loading Lynx example…

Size

You can adjust the fog size in all directions at once using size. Using sizes allows you to specify different sizes for each direction.

Loading Lynx example…
Loading Lynx example…

All Directions

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

Loading Lynx example…

Hide Scrollbar

Using hideScrollBar, you can hide the scrollbar while maintaining the fog effect.

Loading Lynx example…

Table of contents