Search code examples
reactjsreact-nativenative-base

Change placeholder font style on native-base


I use native base Input Component, and I tried to customize the placeholder font style like the following example, but it does not change the placeholder. It changed the style of the user typed input value. How can I change the placeholder font style?

<Input
  style={{color:"blue", fontFamily:"Arial"}}
  placeholder="I am blue and Arial font"
/>

Update

I already tried placeholderStyle like the following example, but it does not work.

<Input
  placeholderStyle={{color:"blue", fontFamily:"Arial"}}
  placeholder="I am blue and Arial font"
/>

Solution

  • The font family is the same for the text input and the placeholder, however I assume you meant that the color didn't change for the placeholder, here's the solution.

    Do this:

    <Input
      style={{color:"blue", fontFamily:"Arial"}}
      placeholderTextColor="blue"
      placeholder="I am blue and Arial font"
    />