Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"
/>
like image 867
Set Kyar Wa Lar Avatar asked Dec 10 '22 07:12

Set Kyar Wa Lar


1 Answers

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"
/>
like image 59
random1234 Avatar answered Dec 28 '22 06:12

random1234