If you want to make your own animation you can wrap that label Text into a Animated.View component and give animation.

Try this:

import React, { useEffect, useState, useRef } from "react";
import {
  View,
  StyleSheet,
  TextInput,
  Text,
  Animated,
  Pressable,
} from "react-native";

const TestScreen = () => {
  const [value, setValue] = useState("");
  const moveText = useRef(new Animated.Value(0)).current;

  useEffect(() => {
    if (value !== "") {
        moveTextTop();
    } else if (value === "") {
        moveTextBottom();
    }
  }, [value])

  const onChangeText = (text: string) => {
    setValue(text);
  };

  const onFocusHandler = () => {
    if (value !== "") {
      moveTextTop();
    }
  };

  const onBlurHandler = () => {
    if (value === "") {
      moveTextBottom();
    }
  };

  const moveTextTop = () => {
    Animated.timing(moveText, {
      toValue: 1,
      duration: 200,
      useNativeDriver: true,
    }).start();
  };

  const moveTextBottom = () => {
    Animated.timing(moveText, {
      toValue: 0,
      duration: 200,
      useNativeDriver: true,
    }).start();
  };

  const yVal = moveText.interpolate({
    inputRange: [0, 1],
    outputRange: [4, -20],
  });

  const animStyle = {
    transform: [
      {
        translateY: yVal,
      },
    ],
  };

  return (
    <View style={styles.container}>
      <Animated.View style={[styles.animatedStyle, animStyle]}>
        <Text style={styles.label}>Enter Your Name</Text>
      </Animated.View>
      <TextInput
        autoCapitalize={"none"}
        style={styles.input}
        value={value}
        onChangeText={(text: string) => onChangeText(text)}
        editable={true}
        onFocus={onFocusHandler}
        onBlur={onBlurHandler}
        blurOnSubmit
      />
    </View>
  );
};
export default TestScreen;

const styles = StyleSheet.create({
  container: {
    marginBottom: 20,
    marginTop: 20,
    backgroundColor: "#fff",
    paddingTop: 5,
    paddingHorizontal: 10,
    borderWidth: 1,
    borderColor: "#bdbdbd",
    borderRadius: 2,
    width: "90%",
    alignSelf: "center",
  },
  icon: {
    width: 40,
    justifyContent: "center",
    alignItems: "center",
  },
  input: {
    fontSize: 13,
    height: 35,
    color: "#000",
  },
  label: {
    color: "grey",
    fontSize: 10,
  },
  animatedStyle: {
    top: 5,
    left: 15,
    position: 'absolute',
    borderRadius: 90,
    zIndex: 10000,
  },
});

Answer from Rahman Haroon on Stack Overflow
🌐
npm
npmjs.com › package › react-native-floating-label-input
react-native-floating-label-input - npm
November 4, 2023 - This is a React-Native TextInput component, containing a floating placeholder, visible even after filled in, that you can freely modify its styles 💅🎉
      » npm install react-native-floating-label-input
    
Published: Nov 04, 2023
Version: 1.4.3
🌐
GitHub
github.com › Dagic-zewdu › react-native-floating-label-inputs
GitHub - Dagic-zewdu/react-native-floating-label-inputs: A customizable React Native TextInput with its placeholder always shown. Includes container, input styles, error handling, and a bunch else. · GitHub
This is a fully customizable React Native package, and its props extend from React-native textinput props. If your label floats in the text input while focusing or blurring, this is the perfect package for you, with multiple examples to meet ...
Author: Dagic-zewdu
🌐
Medium
medium.com › did-you-know-the-journal-blog › creating-input-floating-label-component-in-react-native-3768580f8ad7
Creating input floating label component in React Native
August 17, 2020 - If the input is focused or filled, the label will slide up 25px, otherwise the label will slide back down that same amount of px. ... import React, { useState, useCallback, useRef } from ‘react’; import { Container, PlaceholderLabel, ...
🌐
GitHub
github.com › Cnilton › react-native-floating-label-input
GitHub - Cnilton/react-native-floating-label-input: A customizable React Native TextInput with its placeholder always shown. Includes masks, global styles, character count, and a bunch else.
December 6, 2019 - This is a React-Native TextInput component, containing a floating placeholder, visible even after filled in, that you can freely modify its styles 💅🎉
Starred by 334 users
Forked by 63 users
Languages: TypeScript 62.0% | Java 17.4% | Objective-C 11.8% | Ruby 3.9% | JavaScript 3.3% | Starlark 1.6% | TypeScript 62.0% | Java 17.4% | Objective-C 11.8% | Ruby 3.9% | JavaScript 3.3% | Starlark 1.6%
🌐
npm
npmjs.com › package › react-native-floating-labels
react-native-floating-labels - npm
An animated floating label <TextInput> component for React Native (iOS, Android, and web via react-native-web). ... <FloatingLabel labelStyle={{color: '#6200ea'}} inputStyle={{borderColor: '#6200ea', borderWidth: 2, borderRadius: 8}} ...
      » npm install react-native-floating-labels
    
Published: Apr 09, 2026
Version: 2.1.2
🌐
npm
npmjs.com › package › react-native-floating-label-text-input
react-native-floating-label-text-input - npm
iOS text input with animated floating label. Latest version: 0.1.5, last published: 9 years ago. Start using react-native-floating-label-text-input in your project by running `npm i react-native-floating-label-text-input`. There are no other projects in the npm registry using react-native-floating-label-text-input.
      » npm install react-native-floating-label-text-input
    
Published: Jul 30, 2017
Version: 0.1.5
Top answer
1 of 3
3

If you want to make your own animation you can wrap that label Text into a Animated.View component and give animation.

Try this:

import React, { useEffect, useState, useRef } from "react";
import {
  View,
  StyleSheet,
  TextInput,
  Text,
  Animated,
  Pressable,
} from "react-native";

const TestScreen = () => {
  const [value, setValue] = useState("");
  const moveText = useRef(new Animated.Value(0)).current;

  useEffect(() => {
    if (value !== "") {
        moveTextTop();
    } else if (value === "") {
        moveTextBottom();
    }
  }, [value])

  const onChangeText = (text: string) => {
    setValue(text);
  };

  const onFocusHandler = () => {
    if (value !== "") {
      moveTextTop();
    }
  };

  const onBlurHandler = () => {
    if (value === "") {
      moveTextBottom();
    }
  };

  const moveTextTop = () => {
    Animated.timing(moveText, {
      toValue: 1,
      duration: 200,
      useNativeDriver: true,
    }).start();
  };

  const moveTextBottom = () => {
    Animated.timing(moveText, {
      toValue: 0,
      duration: 200,
      useNativeDriver: true,
    }).start();
  };

  const yVal = moveText.interpolate({
    inputRange: [0, 1],
    outputRange: [4, -20],
  });

  const animStyle = {
    transform: [
      {
        translateY: yVal,
      },
    ],
  };

  return (
    <View style={styles.container}>
      <Animated.View style={[styles.animatedStyle, animStyle]}>
        <Text style={styles.label}>Enter Your Name</Text>
      </Animated.View>
      <TextInput
        autoCapitalize={"none"}
        style={styles.input}
        value={value}
        onChangeText={(text: string) => onChangeText(text)}
        editable={true}
        onFocus={onFocusHandler}
        onBlur={onBlurHandler}
        blurOnSubmit
      />
    </View>
  );
};
export default TestScreen;

const styles = StyleSheet.create({
  container: {
    marginBottom: 20,
    marginTop: 20,
    backgroundColor: "#fff",
    paddingTop: 5,
    paddingHorizontal: 10,
    borderWidth: 1,
    borderColor: "#bdbdbd",
    borderRadius: 2,
    width: "90%",
    alignSelf: "center",
  },
  icon: {
    width: 40,
    justifyContent: "center",
    alignItems: "center",
  },
  input: {
    fontSize: 13,
    height: 35,
    color: "#000",
  },
  label: {
    color: "grey",
    fontSize: 10,
  },
  animatedStyle: {
    top: 5,
    left: 15,
    position: 'absolute',
    borderRadius: 90,
    zIndex: 10000,
  },
});

2 of 3
1

The Answer is good but you might not need useEffect in this case, this can be refactored as this

import React, {useState, useRef} from 'react';
import {View, StyleSheet, TextInput, Text, Animated} from 'react-native';

const TestScreen = () => {
  const [value, setValue] = useState('');
  const moveText = useRef(new Animated.Value(0)).current;

  const onFocusHandler = () => {
    if (!value) {
      moveTextTop();
    }
  };
  const onBlur = () => {
    if (!value) {
      moveTextBottom();
    }
  };
  const onChangeText = (textValue: string) => {
    setValue(textValue);
    if (textValue !== '') {
      moveTextTop();
    } else if (value === '') {
      moveTextBottom();
    }
  };

  const moveTextTop = () => {
    Animated.timing(moveText, {
      toValue: 1,
      duration: 200,
      useNativeDriver: true,
    }).start();
  };

  const moveTextBottom = () => {
    Animated.timing(moveText, {
      toValue: 0,
      duration: 200,
      useNativeDriver: true,
    }).start();
  };

  const yVal = moveText.interpolate({
    inputRange: [0, 1],
    outputRange: [4, -20],
  });

  const animStyle = {
    transform: [{translateY: yVal}],
  };

  return (
    <View style={styles.container}>
      <Animated.View style={[styles.animatedStyle, animStyle]}>
        <Text style={styles.label}>Enter Your Name</Text>
      </Animated.View>
      <TextInput
        value={value}
        onBlur={onBlur}
        style={styles.input}
        onFocus={onFocusHandler}
        onChangeText={onChangeText}
      />
    </View>
  );
};
export default TestScreen;

const styles = StyleSheet.create({
  container: {
    marginBottom: 20,
    marginTop: 20,
    backgroundColor: '#fff',
    paddingTop: 5,
    paddingHorizontal: 10,
    borderWidth: 1,
    borderColor: '#bdbdbd',
    borderRadius: 2,
    width: '90%',
    alignSelf: 'center',
  },
  icon: {
    width: 40,
    justifyContent: 'center',
    alignItems: 'center',
  },
  input: {
    fontSize: 13,
    height: 35,
    color: '#000',
  },
  label: {
    color: 'grey',
    fontSize: 10,
  },
  animatedStyle: {
    top: 5,
    left: 15,
    position: 'absolute',
    borderRadius: 90,
    zIndex: 10000,
  },
});

🌐
GitHub
github.com › eyaleizenberg › react-native-floating-label-text-input
GitHub - eyaleizenberg/react-native-floating-label-text-input: A React Native component for floating label text input
September 19, 2022 - import FloatLabelTextInput from 'react-native-floating-label-text-input'; class SomeComponent extends Component { render () { return ( <View> <FloatLabelTextInput placeholder={"name of field"} value={"value of field"} onFocus={@myFocusFunction} onBlur={@onBlurFunction} /> </View> ); } }
Starred by 284 users
Forked by 81 users
Languages: JavaScript 100.0% | JavaScript 100.0%
Find elsewhere
Starred by 66 users
Forked by 12 users
Languages: JavaScript 85.6% | Objective-C 14.4% | JavaScript 85.6% | Objective-C 14.4%
🌐
Medium
medium.com › @dagi.zewdu.dz › how-to-make-a-reusable-floating-label-in-react-native-text-input-9c3314518f6a
How to make a reusable floating label in React Native text input | by Dagi Zewdu Dz | Medium
January 5, 2023 - Now let's add conditional floating which means if the text input is on event onchangeText the label should go app. After writing the text if there is no value the label should go to an initial position(go down). otherwise, it should remain there.
🌐
GitHub
github.com › verticalstrategy › react-native-floating-label-text-input
GitHub - verticalstrategy/react-native-floating-label-text-input: Floating label text input component for React Native.
import FloatingLabelTextInput from 'react-native-floating-label-text-input' <FloatingLabelTextInput containerStyle={{ width: '100%', height: 45 }} onChangeText={this.onChangeText} placeholder={`Name`} value={this.state.name} />
Author: verticalstrategy
🌐
Ifelsething
ifelsething.com › post › floating-label-react-native-text-input
Custom Floating Label Text Input in React Native - ifelsething
One of the most common text input variants we can see is a floating label input where the label will float to top when input is focused. This can be implemented using third party libraries like react-native-floating-label-input or creating our own custom floating label text input.
🌐
Gosha Spark
goshacmd.com › floating-label-input-rn-animated
The making of a floating-label input with React Native's Animated API | Gosha Spark
August 15, 2017 - We could, essentially, have a state of whether an input is focused. Then, depending on this piece of state, we could choose where to place the label, and which styles to apply to it. Since the label can be in different places and we don't want it to affect the layout of the component, we will absolutely position the label. To make sure it has space, we will also add a top padding to the wrapping view. class FloatingLabelInput extends Component { state = { isFocused: false, }; handleFocus = () => this.setState({ isFocused: true }); handleBlur = () => this.setState({ isFocused: false }); render() { const { label, ...props } = this.props; const { isFocused } = this.state; const labelStyle = { position: "absolute", left: 0, top: !isFocused ?
🌐
ReactScript
reactscript.com › home › categories › form › react native floating label text input
React Native Floating Label Text Input | Reactscript
April 30, 2016 - React Native Floating Label Text Input · eyaleizenberg Added 10 years ago · Live Demo Download Source Code · This component will render an iOS styled text field with floating label animation.
🌐
GitHub
github.com › mayank-patel › react-native-floating-labels
GitHub - mayank-patel/react-native-floating-labels: React Native Floating Labels Library
'use strict'; var React = require('react-native'); var FloatingLabel = require('react-native-floating-labels'); var { AppRegistry, StyleSheet, View, } = React; class form extends React.Component { constructor(props, context) { super(props, context); this.state = { dirty: false, }; } onBlur() { console.log('#####: onBlur'); } render() { return ( <View style={styles.container}> <FloatingLabel labelStyle={styles.labelInput} inputStyle={styles.input} style={styles.formInput} value='john@email.com' onBlur={this.onBlur} >Email</FloatingLabel> <FloatingLabel labelStyle={styles.labelInput} inputStyle=
Starred by 163 users
Forked by 74 users
Languages: JavaScript 100.0% | JavaScript 100.0%
🌐
YouTube
youtube.com › code spring
Floating Label TextInput in React Native #reactnative - YouTube
Animated Floating Label TextInput #ui with #reactnative 👨‍💻, for source file check below. The TextInput label will goes up and reduce its size when input i...
Published: February 1, 2024
Views: 1K
🌐
GitHub
github.com › manish-ironman › react-native-floating-label-inputbox
GitHub - manish-ironman/react-native-floating-label-inputbox · GitHub
To install just input the following ... style · Required Field · Props · Type · Description · label · Text · It is a placeholder and label....
Author: manish-ironman
🌐
npm
npmjs.com › package › @mackscript › react-native-float-label-input
@mackscript/react-native-float-label-input - npm
April 10, 2025 - import React, { useState } from 'react'; import { View, SafeAreaView } from 'react-native'; import FloatingLabelInput from '@mackscript/react-native-float-label-input'; export default function App() { const [formData, setFormData] = useState({ name: '', email: '', phone: '', }); const handleChange = (key: string, value: string) => { setFormData((prev) => ({ ...prev, [key]: value })); }; return ( <SafeAreaView> <View style={{ margin: 20 }}> <FloatingLabelInput label='Full Name' value={formData.name} onChangeText={(text) => handleChange('name', text)} /> <FloatingLabelInput label='Email' value={formData.email} keyboardType='email-address' onChangeText={(text) => handleChange('email', text)} /> <FloatingLabelInput label='Phone Number' value={formData.phone} keyboardType='phone-pad' onChangeText={(text) => handleChange('phone', text)} /> </View> </SafeAreaView> ); }
      » npm install @mackscript/react-native-float-label-input
    
Top answer
1 of 2
2

You had 4 separate questions, so I will address them in order:

Snack with changes implemented so you can follow along

1) Text Input widths

First of all, the label components are currently covering up the <Input> Components, so I removed them for now. They seem to be intended to function as placeholder components, so we can fix the `placeholder instead

Inspecting the elements, I see that both inputs have the same width, but the <Item>s containing them are different widths. This is caused by the last attribute on the second <Item>.

Removing the last attribute from <Item floatingLabel last> yields <Item floatingLabel>, which now has the same width bottom white border for both <Item> components

2) Button length

The button size properties are width and height

const styles = StyleSheet.create({
    ...
    button: {
        ...
        width: '170%',
        height: '15%',
        ...
    },

3) Button text capitalization

The default prop for a in React Native includes an uppercase prop, so setting it to the javascript false will turn off the all-caps styling on text within the button.

<Button hasText transparent>
    <Text style={styles.signupText} uppercase={false}>
    {"Don't have an account? Sign Up"}
    </Text>
</Button>

https://github.com/GeekyAnts/NativeBase/issues/1033

4) Removing white header

To remove the header, we can add a static navigationOptions property to your Login component

export class Login extends Component {
  static navigationOptions = {
    headerShown: false,
  };

  constructor(props) {
    super(props);
    ...

https://reactnavigation.org/docs/en/headers.html

Hide header in stack navigator React navigation

2 of 2
1

I was frustrated with the solutions on the internet, none of which worked according to my needs. So I wrote custom solution, made it maximum dynamic, and uploaded as a library, here it is.

Note: This is Expo supported solution

Preview:

to install:

npm i fiction-expo-floating-label-input

to Import:

import {FictionFloatingLabelInput} from "fiction-expo-floating-label";

basic Example:

<FictionFloatingLabelInput
  label="First Name"
  value={x} // just a state variable
  labelFocusedTop={10} // Y position of label when focused
  labelUnFocusedTop={-5} // Y position of label when un-focused
  onChangeText={(t)=>setX(t)} // setting state variable
/>

Full Example:

<FictionFloatingLabelInput
  label="First Name" // label itself
  value={x} // just a state variable

  labelFocusedTop={-5} // Y position of label when focused
  labelUnFocusedTop={10} // Y position of label when un-focused

  containerStyle={{}} // container style
  focusedContainerStyle={{}} // container style when focused
  unFocusedContainerStyle={{}} // container style when un-focused

  subContainerStyle={{}} // child container style
  focusedSubContainerStyle={{}} // child container style when focused
  unfocusedSubContainerStyle={{}} // child container style when un-focused

  labelStyle={{}} // label style
  focusedLabelStyle={{}} // label style when focused
  unfocusedLabelStyle={{}} // label style when un-focused

  textInputStyle={{}} // text input style
  focusedTextInputStyle={{}} // text input style when focused
  unFocusedTextInputStyle={{}} // text input style when un-focused

  labelFontSizeUnFocused={14} // label font size when un-focused
  labelFontSizeFocused={10} // label font size when focused

  labelColorUnFocused={"red"} // label color when un-focused
  labelColorFocused={"green"} // label color when focused

  underlineColorAndroid={"transparent"} // you know this one, right?

  selectionColor={"red"} // cursor and selection color

  onChangeText={(value)=>setX(value)} // setting state variable

  // all other text input props are supported too, Except onFocus and onBlur, 
  // instead below focus and blur events are explained

  preOnFocus={()=>{ 
    // gets called before the animation starts , focusing
  }}

  postOnFocus={()=>{ 
    // gets called after the animation ends , focusing
  }}

  preOnBlur={()=>{ 
    // gets called before the animation starts , unfocusing
  }}

  postOnBlur={()=>{ 
    // gets called after the animation ends, unfocusing
  }}

/>

Note: Don't forget to declare state variable as x, like

const [x, setX] = React.useState("")
🌐
npm
npmjs.com › package › react-native-floating-label
react-native-floating-label - npm
A floating label text input factory for tcomb-form-native. Latest version: 0.2.3, last published: 10 years ago. Start using react-native-floating-label in your project by running `npm i react-native-floating-label`. There are no other projects in the npm registry using react-native-floating-label.
      » npm install react-native-floating-label
    
Published: Jul 15, 2016
Version: 0.2.3
Author: Alvaro Medina Ballester