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, ...
🌐
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
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 › 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-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
🌐
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
🌐
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.
🌐
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.
🌐
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
🌐
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
Starred by 66 users
Forked by 12 users
Languages: JavaScript 85.6% | Objective-C 14.4% | JavaScript 85.6% | Objective-C 14.4%
🌐
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 ?
🌐
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%
🌐
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.
🌐
Skypack
skypack.dev › view › react-native-custom-floating-input-label
npm:react-native-custom-floating-input-label | Skypack
Hereby you can customize the label, active color, error color and changing the text will get reflected in the main thread which is similar to the native TextInput. ... Customized border color and based on the keyboard type validations may occur. ... react-nativecustomfloatinglabelTextInputfloating textfloating inputcustom floating textreact nativecustomised text inputreact native customised floating text inputanimated labellabel animated text inputlabel text inputanimated text inputfloating text labelfloating text label inputreact-nativeandroidiosreact-native-componentnativemobileinputmask
🌐
YouTube
youtube.com › code for ever
React Native-Floating Label Textinput - YouTube
In this video tutorial guides you how to display a floating label text input using react-native-floating-label-input libraryReact Native Floating Label:https...
Published: November 28, 2020
Views: 4K
🌐
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
    
🌐
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