How to style Label on TextInput ?
See original GitHub issueAsk your Question
I want to make Label
on textinput to small than text inside TextInput
import {
configureFonts,
DefaultTheme,
DarkTheme,
TextInput,
} from 'react-native-paper';
const fontConfig = {
default: {
regular: {
fontFamily: Fonts.FONTS.PRIMARY,
fontWeight: 'normal',
fontSize: 10, // <-- Try using this but not work
},
},
};
const theme = {
...DarkTheme,
roundness: 5,
colors: {
...DarkTheme.colors,
text: Theme.COLORS.WHITE,
placeholder: Theme.COLORS.WHITE,
primary: Theme.COLORS.SWITCH_ON,
background: 'transparent',
},
fonts: configureFonts(fontConfig),
};
<TextInput
theme={tema}
style={inputStyles}
selectionColor={Theme.COLORS.WHITE}
underlineColor={Theme.COLORS.WHITE}
dense={true}
{...this.props}
/>
Screenshot :
Current :
const styles = StyleSheet.create({
input: {
fontSize: 14,
},
});
Expected :
const styles = StyleSheet.create({
input: {
fontSize: 34,
},
});
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Customize TextInput Label of the react-native-paper in the ...
You can pass fontSize via style prop. However it will affect both label and input text. There is no way to change only...
Read more >HTML Inputs and Labels: A Love Story | CSS-Tricks
There are two ways to pair a label and an input. One is by wrapping the input in a label (implicit), and the...
Read more >The Label element - HTML: HyperText Markup Language | MDN
To explicitly associate a <label> element with an <input> element, you first need to add the id attribute to the <input> element. Next,...
Read more >TextInput · React Native Paper
A component to allow users to input text. ... The text or component to use for the floating label. ... Whether to style...
Read more >How to create fancy jumping text input labels - Bootcamp
Below is what the two cases look like expressed in CSS. The snippet sets the style of the label depending on the state...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can pass
fontSize
viastyle
prop. However it will affect both label and input text. There is no way to change only one of them.label={<Text style={{fontSize: 20}}>{t(‘PersonalDetailsYuvitalOrg:editInput.firstName’)}</Text>}