How to Create Custom Reactions in a Compose Chat App
Blog post from Stream
The v5 Compose Chat SDK introduces a ReactionsTypes API, enabling more complex reactions such as animated emojis or uploaded images, similar to social media platforms, while ensuring the Jetpack Compose UI components remain stable. Users can override default reactions like thumbs up, love, and LOL with custom reactions using the reactionIconFactory property in ChatTheme or the reactionTypes property in the SelectedReactionsMenu or SelectedMessageMenu. The newly introduced ReactionIconFactory class allows developers to create custom icons by implementing methods such as createReactionIcon and createReactionIcons, while also checking if reactions are supported. Additionally, the SDK supports adding animations, including spring animations, to reaction icons through components like DefaultReactionOptionItem and CustomReactionOptionItem. The SDK's customization features allow users to integrate custom reactions and animations into the SelectedReactionsMenu and SelectedMessageMenu, enhancing the interactive experience. The Stream Jetpack Compose UI components are highly customizable, allowing developers to add new components or modify existing ones, with resources available on GitHub for further exploration and feedback opportunities on Twitter and GitHub.