Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can change the color of the message box #640

Closed
dibiro opened this issue Nov 16, 2017 · 14 comments
Closed

how can change the color of the message box #640

dibiro opened this issue Nov 16, 2017 · 14 comments
Labels

Comments

@dibiro
Copy link

dibiro commented Nov 16, 2017

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

@Frexuz
Copy link

Frexuz commented Nov 17, 2017

  renderBubble (props) {
    return (
      <Bubble
        {...props}
        wrapperStyle={{
          right: {
            backgroundColor: Colors.primary
          }
        }}
      />
    )
  }

<GiftedChat
  ...
  renderBubble={this.renderBubble}

@xcarpentier
Copy link
Collaborator

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

@alamorre
Copy link

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

@kg-currenxie
Copy link

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

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

@juanmanuelco
Copy link

And if i wanna change the text color on bubble ?

@boukarsall
Copy link

renderBubble (props) {
      return (
        <Bubble
          {...props}
          textStyle={{
            right: {
              color: "white"
            },
            left: {
              color: "white"
            }
          }}
        />
      )
    }

@hackrx
Copy link

hackrx commented Jul 16, 2020

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

@Nagasai97
Copy link

Nagasai97 commented Feb 15, 2021

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

@alenseferovic1
Copy link

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

@kg-currenxie
Copy link

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 🤔

@capridigitalmedia
Copy link

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

@deidalopez
Copy link

@capridigitalmedia This may be helpful
#268 (comment)

Simple solution.

<View style={{backgroundColor: '#yourcolor'}}>
  <GiftedChat ...props />
</View>

@saurabh-000
Copy link

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

@rytilahti-juuso
Copy link

rytilahti-juuso commented Aug 6, 2023

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
Labels
Projects
None yet
Development

No branches or pull requests