Skip to content

feat(scroll-area): add onScroll prop#40

Merged
nipsysdev merged 3 commits into
mainfrom
feat/scroll-area-onscroll
May 8, 2026
Merged

feat(scroll-area): add onScroll prop#40
nipsysdev merged 3 commits into
mainfrom
feat/scroll-area-onscroll

Conversation

@nipsysdev
Copy link
Copy Markdown
Owner

Summary

  • Added onScroll callback prop to ScrollArea component for scroll event handling
  • Exported ScrollAreaProps type for TypeScript consumers
  • Removed unnecessary TooltipPortal export (handled internally)
  • Bumped version to 1.1.3

Changes

ScrollArea Component

  • New onScroll prop accepts React.UIEventHandler<HTMLDivElement>
  • Enables common use cases: infinite scroll, scroll position tracking, scroll-to-top visibility
  • Backward compatible - prop is optional

Example Usage

<ScrollArea 
  className="h-full"
  onScroll={(e) => {
    const { scrollTop, scrollHeight, clientHeight } = e.currentTarget;
    if (scrollTop + clientHeight >= scrollHeight - 100) {
      loadMore();
    }
  }}
>
  {items}
</ScrollArea>

@nipsysdev nipsysdev merged commit e1858e0 into main May 8, 2026
6 checks passed
@nipsysdev nipsysdev deleted the feat/scroll-area-onscroll branch May 8, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant