# Scroll Fog URL: /react/components/scroll-fog Source: https://github.com/daangn/seed-design/blob/dev/docs/content/react/components/scroll-fog.mdx Acts as a hint that visually informs users that there is additional content in a scrollable area. 사용 가능 버전: @seed-design/react@1.1.3, @seed-design/css@1.1.3 ## Preview ```tsx import { Box, ScrollFog, VStack } from "@seed-design/react"; export default function ScrollFogPreview() { return (
{Array.from({ length: 20 }, (_, i) => ( {i + 1} ))}
); } ``` This Scroll Fog component is a component for simpler scroll hints only, rather than [Chakra ScrollArea](https://chakra-ui.com/components/scroll-area), [Radix ScrollArea](https://www.radix-ui.com/primitives/components/scroll-area), or [Base UI ScrollArea](https://base-ui.com/react/components/scroll-area). It may be expanded later if additional scrollbar functionality is needed. ## Usage ```tsx import { ScrollFog } from "@seed-design/react"; ``` ```tsx
{/* Scrollable content */}
Content
``` ## Props ### Scroll Fog ## 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 ```tsx // Vertical scroll - need top/bottom padding
Content
// Horizontal scroll - need left/right padding
Content
``` - [Bottom Sheet - bottom 80px, top 20px padding](/react/components/bottom-sheet#with-scroll-fog) - [Chip Tabs - 20px left/right padding](/react/components/chip-tabs#with-scroll-fog) ### 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. ```tsx import { HStack, ScrollFog } from "@seed-design/react"; export default function ScrollFogHorizontal() { return (
{Array.from({ length: 15 }, (_, i) => (
{i + 1}
))}
); } ``` ### Size You can adjust the scroll effect size using the `size` attribute. You can adjust the size for each direction using the `sizes` attribute. ```tsx import { ScrollFog } from "@seed-design/react"; export default function ScrollFogSize() { return (
{Array.from({ length: 100 }, (_, i) => (
{i + 1}
))}
); } ``` ```tsx import { ScrollFog } from "@seed-design/react"; export default function ScrollFogSize() { return (
{Array.from({ length: 100 }, (_, i) => (
{i + 1}
))}
); } ``` ### All Directions When 2D scrolling is needed, you can apply fog effects in all directions using `placement={["top", "bottom", "left", "right"]}`. ```tsx import { ScrollFog } from "@seed-design/react"; export default function ScrollFogAllDirections() { return (
{Array.from({ length: 100 }, (_, i) => (
{i + 1}
))}
); } ``` ### Hide Scrollbar You can hide the scrollbar using the `hideScrollBar` attribute. ```tsx import { ScrollFog } from "@seed-design/react"; export default function ScrollFogHideScrollbar() { return (
{Array.from({ length: 100 }, (_, i) => (
{i + 1}
))}
); } ```