Skip to content

feat(conversation): customizable scrollbar for conversation content#392

Open
kejiwuxian wants to merge 2 commits intovercel:mainfrom
kejiwuxian:feat/customizable-scrollbar-for-conversation-content
Open

feat(conversation): customizable scrollbar for conversation content#392
kejiwuxian wants to merge 2 commits intovercel:mainfrom
kejiwuxian:feat/customizable-scrollbar-for-conversation-content

Conversation

@kejiwuxian
Copy link

@kejiwuxian kejiwuxian commented Mar 4, 2026

Customizable scrollbar for conversation using radix-ui ScrollArea primitive, compatible with scrollClassName styling.

This PR implements an easily customizable cross-browser scrollbar using radix-ui ScrollArea primitive while keeping the stick-to-bottom behavior intact, providing a better developer and user experience.

Showcase

All tests passed
image

Copilot AI review requested due to automatic review settings March 4, 2026 23:29
@vercel
Copy link
Contributor

vercel bot commented Mar 4, 2026

@kejiwuxian is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ConversationContent implementation to use shadcn/ui’s ScrollArea so the conversation list can have a customizable, cross-browser scrollbar while preserving the stick-to-bottom behavior from use-stick-to-bottom.

Changes:

  • Replaces StickToBottom.Content with shadcn ScrollArea in ConversationContent.
  • Adds scrollClassName and effect logic to target/style the ScrollArea viewport and wire it into use-stick-to-bottom.
  • Updates props typing for ConversationContent to align with ScrollArea props.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rovo89
Copy link

rovo89 commented Mar 5, 2026

I also want to use ScrollArea, so I might test your implementation. Looking at the changes, you seem to use the context, but it's it you need to have the provider somewhere? And would it also work with using the ScrollArea component from shadcn instead of the primitives?

@kejiwuxian
Copy link
Author

kejiwuxian commented Mar 5, 2026

I also want to use ScrollArea, so I might test your implementation. Looking at the changes, you seem to use the context, but it's it you need to have the provider somewhere? And would it also work with using the ScrollArea component from shadcn instead of the primitives?

Hi Rovo, the stick-to-bottom context is provided by the StickToBottom component in the Conversation component. Since the ConversationContent is supposed to be wrapped by Conversation, the context should always be available.

I did try to use the Shadcn ScrollArea component, so radix-ui doesn't have to be added as a dependency, but it's very tricky to have both the ScrollArea and stick-to-bottom to function in harmony.

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.

3 participants