React-native-paper: Can't adjust font size on TextInput

Created on 13 Sep 2018  路  11Comments  路  Source: callstack/react-native-paper

Current behaviour

Can't adjust font size of button text, textinput and text

Expected behaviour

fontSize is adjustable

What have you tried

| software | version
| --------------------- | -------
| ios or android | both
| react-native | 16.4.1
| react-native-paper | ^2.0.1
| node | v9.6.1
| npm or yarn | 6.4.0

enhancement

Most helpful comment

The default font size is way to small for buttons, being able to customize the size of it I think it's mandatory for any reasonable ui kit 馃檮

All 11 comments

In Text should be possible passing style={{ fontSize: 24 }}.

Hi @ferrannp, Text component work fine,
how about fontSize of Button and TextInput?

543 is for TextInput. Nothing yet for buttons.

Me too. I really need fontSize for Button.
For now, <Button style={{ fontSize: xx }}/> doesn't work. It does not change button text size.

@gluons does it work if you wrap your own Text inside a Button ?

@ferrannp It seems to work partially. Text size changed but icon size isn't changed.
And icon is misplaced. Button doesn't look great.

P.S. I also Button's icon.

The default font size is way to small for buttons, being able to customize the size of it I think it's mandatory for any reasonable ui kit 馃檮

@bogdansoare, you can just do, for example:

<Button onPress={() => {}}>
  <Text style={{ fontSize: 18 }}>Default</Text>
</Button>

For TextInput is more tricky as if you change the font size, all animations like labels would be broken. The TextInput component just needs much more work for supporting this.

@ferrannp It can change only button text. But icon size still really small. And it doesn't match text size.

Button icon size has been fixed to 16. And I'm unable to change icon size of button.

https://github.com/callstack/react-native-paper/blob/3765a079c82da022be8302d356a7d7ab73abc74f/src/components/Button.js#L252-L256

For TextInput is more tricky as if you change the font size, all animations like labels would be broken. The TextInput component just needs much more work for supporting this.

So I wasted so many hours using paper and the most basic thing, font size, is not available? Why would anyone use this library then lol?

@spyshower Just think about how many hours did you save by using Paper... If you are not happy with our library you can always send PR with improvements or make a fork and develop on your own.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mihaidaviddev picture mihaidaviddev  路  3Comments

sritharanpalani picture sritharanpalani  路  4Comments

yaronlevi picture yaronlevi  路  3Comments

kpervin picture kpervin  路  3Comments

zachariahtimothy picture zachariahtimothy  路  3Comments