Skip to content

Conversation

@ab192130
Copy link

Summary

Adds an optional viewportRef prop to ScrollArea to allow direct access to the underlying Radix Viewport element. This enables seamless integration with list virtualization libraries (e.g. TanStack Virtual) that require a direct reference to the scroll container.

Impact

  • ✅ No breaking changes
  • ✅ Improved compatibility with virtualization libraries
  • ✅ Backwards compatible

Adds an optional viewportRef prop to ScrollArea to allow direct access to the underlying Radix Viewport element. This enables seamless integration with list virtualization libraries (e.g. TanStack Virtual) that require a direct reference to the scroll container. No breaking changes.
@vercel
Copy link
Contributor

vercel bot commented Nov 30, 2025

@ab192130 is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@ab192130 ab192130 changed the title feat: expose ScrollArea viewport ref for virtualizers feat(scroll-area): expose viewport ref for virtualizers Nov 30, 2025
@ab192130 ab192130 marked this pull request as draft December 3, 2025 16:00
@ab192130 ab192130 marked this pull request as ready for review December 3, 2025 16:01
Use React.Ref with ComponentRef type instead of RefObject for more accurate typing of the ScrollAreaPrimitive.Viewport component
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.

2 participants