Skip to content

how can change the color of the message box #640

Closed

Description

@dibiro

I need to change the color of the message box from blue to orange

Activity

  1. Frexuz commented on Nov 17, 2017

    @Frexuz
      renderBubble (props) {
        return (
          <Bubble
            {...props}
            wrapperStyle={{
              right: {
                backgroundColor: Colors.primary
              }
            }}
          />
        )
      }
    
    <GiftedChat
      ...
      renderBubble={this.renderBubble}
    
  2. xcarpentier commented on Dec 21, 2017

    @xcarpentier
    Collaborator

    I close this issue but create a FAQ in readme to refer it: https://github.com/FaridSafi/react-native-gifted-chat#questions

  3. alamorre commented on Jun 19, 2019

    @alamorre

    I see what you're doing but where does that Bubble component come from and how do you import it?

  4. kg-currenxie commented on Jun 20, 2019

    @kg-currenxie

    It's just the normal bubble from gifted-chat, but we just override the default styles

    import { Bubble } from 'react-native-gifted-chat'

  5. juanmanuelco commented on Oct 28, 2019

    @juanmanuelco

    And if i wanna change the text color on bubble ?

  6. boukarsall commented on Nov 30, 2019

    @boukarsall
    renderBubble (props) {
          return (
            <Bubble
              {...props}
              textStyle={{
                right: {
                  color: "white"
                },
                left: {
                  color: "white"
                }
              }}
            />
          )
        }
    
  7. hackrx commented on Jul 16, 2020

    @hackrx

    Can anyone tell me how can I change the shape of the message box
    like this
    image

  8. Nagasai97 commented on Feb 15, 2021

    @Nagasai97

    @hackrx i too need to change the shape of this box...

  9. alenseferovic1 commented on Apr 15, 2021

    @alenseferovic1

    @hackrx Did you find out how to change the shape of message box?

  10. kg-currenxie commented on Apr 15, 2021

    @kg-currenxie

    Haven't tried, but it seems that you have to implement your own complete component, like the bubble itself: https://github.com/FaridSafi/react-native-gifted-chat/blob/master/src/Bubble.tsx 🤔

  11. capridigitalmedia commented on Mar 5, 2022

    @capridigitalmedia

    how do i change the entire chat background color, and foregrounnd color

  12. deidalopez commented on Apr 21, 2022

    @deidalopez

    @capridigitalmedia This may be helpful
    #268 (comment)

    Simple solution.

    <View style={{backgroundColor: '#yourcolor'}}>
      <GiftedChat ...props />
    </View>
    
  13. saurabh-000 commented on May 19, 2022

    @saurabh-000

    @capridigitalmedia
    you can use this prop of react native gifted chat to change the background color of
    messagesContainerStyle={{backgroundColor:Colors.screenBackgroundColor,}}

  14. rytilahti-juuso commented on Aug 6, 2023

    @rytilahti-juuso

    Below is a more complete example on how to modify the styles of the text bubbles using functional components:

    import { GiftedChat, Bubble } from 'react-native-gifted-chat';
    // ...Other imports
    
    export default function ChatScreen() {
      
      const renderBubble = props => { 
        return ( 
          <Bubble 
            {...props} 
            textStyle={{ 
                  right: { color: 'blue', backgroundColor:'gray' }, 
            }} 
            wrapperStyle={{
                right: { backgroundColor: 'orange', }, 
                left: { backgroundColor: 'red', }, 
            }} 
          />
        )}
      //... Other necessary code
      
      return (
        <GiftedChat
          renderBubble={renderBubble}
          // Other props..
        />
      );
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions