Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • NextJS
  • Material UI
  • React Bootstrap
  • React Suite
  • Ant Design
  • Reactstrap
  • BlueprintJS
  • React Desktop
  • React Native
  • React Rebass
  • React Spring
  • React Evergreen
  • ReactJS
  • ReactJS
  • JS Formatter
  • Web Technology
Open In App
Next Article:
Create a Blog App using React-Native
Next article icon

Create a Password Manager using React-Native

Last Updated : 18 May, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

This article will demonstrate how to create a Password Manager Application using React-Native. To assist users in securely storing and managing their passwords, we will develop a Password Manager mobile­ application using React Native for this project. The application will provide functionalities such as adding, viewing, copying, and de­leting stored passwords.

Let's take a look at how our completed project will look:

Password_Manager_using_React-Native


Prerequisites

  • Introduction to React Native
  • React Native Components
  • React Hooks
  • Node.js and Npm

Step-by-Step Implementation

Step 1: Create a React Native Project

Now, create a project with the following command.

npx create-expo-app app-name --template

Note: Replace the app-name with your app name for example : react-native-demo-app

Next, you might be asked to choose a template. Select one based on your preference as shown in the image below. I am selecting the blank template because it will generate a minimal app, as clean as an empty canvas in JavaScript.

It completes the project creation and displays a message: "Your Project is ready!" as shown in the image below.

Now go into your project folder, i.e., react-native-demo

cd app-name

Project Structure:

Step 2: Add dependencies

Add the below dependencies in package.json.

Package.json

{
"dependencies": {
"react-native-paper": "^5.14.0",
"react-native-vector-icons": "^10.2.0",
}
}

Step 3: Run  Application

Start the server by using the following command.

npx expo start

Then, the application will display a QR code.

  • For the Android users,
    • For the Android Emulator, press "a" as mentioned in the image below.
    • For the Physical Device, download the "Expo Go" app from the Play Store. Open the app, and you will see a button labeled "Scan QR Code." Click that button and scan the QR code; it will automatically build the Android app on your device.
  • For iOS users, simply scan the QR code using the Camera app.
  • If you're using a web browser, it will provide a local host link that you can use as mentioned in the image below.

Step 4: Start Coding

This React Native app serves as a password manager. It allows users to add, edit, copy, and delete passwords for various websites. The app maintains a list of passwords, each containing website details, usernames, and masked passwords. Users can copy website names, usernames, and masked passwords to the clipboard for easy access. The app provides an editing feature, initiated by tapping the "Edit" button, enabling users to modify existing passwords.

- Import libraries: Import required libraries at the top of the file.

Dart
// Importing necessary hooks from React import {     useState, // Hook for managing state in functional components     useEffect // Hook for performing side effects in functional components } from "react";  // Importing components and utilities from React Native import {     View, // Container component for layout     Text, // Component for displaying text     TextInput, // Component for user input fields     TouchableOpacity, // Component for touchable buttons     ScrollView, // Component for scrollable views     StyleSheet, // Utility for creating styles     Clipboard, // Utility for interacting with the clipboard } from "react-native";  // Importing Icon component from react-native-vector-icons for displaying icons import Icon from "react-native-vector-icons/FontAwesome"; 


- StyleSheet: Create a StyleSheet to style components like container, Content, heading, subHeading, etc.

JavaScript
// Defining styles for the application using StyleSheet const styles = StyleSheet.create({     // Style for the main container     container: {         flex: 1, // Take up the full height of the screen         margin: 20, // Add margin around the container     },     // Style for the content inside the container     content: {         margin: 15, // Add margin inside the content     },     // Style for the main heading     heading: {         fontSize: 30, // Large font size         fontWeight: "bold", // Bold text         marginBottom: 15, // Space below the heading         textAlign: "center", // Center align the text         color: "#333", // Dark gray color     },     // Style for subheadings     subHeading: {         fontSize: 23, // Slightly smaller font size than the main heading         fontWeight: "bold", // Bold text         marginBottom: 10, // Space below the subheading         color: "#333", // Dark gray color     },     // Style for the "No Data" message     noData: {         fontSize: 17, // Medium font size         fontStyle: "italic", // Italic text         marginBottom: 20, // Space below the message         color: "#666", // Light gray color     },     // Style for the table containing password items     table: {         flexDirection: "row", // Arrange items in a row         backgroundColor: "white", // White background         borderRadius: 15, // Rounded corners         elevation: 4, // Add shadow for Android         marginBottom: 20, // Space below the table         shadowColor: "grey", // Shadow color for iOS         shadowOffset: { width: 0, height: 0 }, // Shadow offset for iOS         shadowRadius: 5, // Shadow radius for iOS         shadowOpacity: 1, // Shadow opacity for iOS     },     // Style for each password item     passwordItem: {         flexDirection: "column", // Arrange items in a column         alignItems: "center", // Center align items         borderBottomWidth: 1, // Add a bottom border         borderBottomColor: "#ddd", // Light gray border color         padding: 15, // Add padding inside the item     },     // Style for each list item (e.g., website, username, password)     listItem: {         flexDirection: "row", // Arrange items in a row         justifyContent: "space-between", // Space out items evenly         alignItems: "center", // Center align items vertically         marginRight: 10, // Space to the right of the item         marginBottom: 10, // Space below the item     },     // Style for the label in the list item     listLabel: {         fontWeight: "bold", // Bold text         marginBottom: 5, // Space below the label         color: "#333", // Dark gray color         fontSize: 19, // Medium font size     },     // Style for the value in the list item     listValue: {         flex: 1, // Take up available space         fontSize: 18, // Medium font size         color: "#444", // Medium gray color         paddingLeft: 10, // Space to the left of the value     },     // Style for the copy icon in the list item     copyIcon: {         marginRight: 10, // Space to the right of the icon         paddingLeft: 10, // Space to the left of the icon     },     // Style for the delete button     deleteButton: {         backgroundColor: "red", // Red background         borderRadius: 4, // Slightly rounded corners         padding: 5, // Add padding inside the button         marginLeft: 10, // Space to the left of the button     },     // Style for the edit button     editButton: {         backgroundColor: "blue", // Blue background         borderRadius: 4, // Slightly rounded corners         padding: 5, // Add padding inside the button         marginRight: 10, // Space to the right of the button     },     // Style for the container holding the edit and delete buttons     buttonsContainer: {         flexDirection: "row", // Arrange buttons in a row     },     // Style for the input fields     input: {         borderWidth: 2, // Border width         borderColor: "#eee", // Light gray border color         paddingVertical: 10, // Vertical padding inside the input         paddingHorizontal: 15, // Horizontal padding inside the input         marginBottom: 20, // Space below the input         fontSize: 16, // Medium font size         borderRadius: 10, // Rounded corners         backgroundColor: "white", // White background         shadowColor: "grey", // Shadow color for iOS         shadowOffset: { width: 0, height: 0 }, // Shadow offset for iOS         shadowRadius: 10, // Shadow radius for iOS         shadowOpacity: 1, // Shadow opacity for iOS         elevation: 4, // Add shadow for Android     },     // Style for the submit button     submitButton: {         backgroundColor: "green", // Green background         color: "white", // White text color         fontWeight: "bold", // Bold text         borderRadius: 10, // Rounded corners         paddingVertical: 15, // Vertical padding inside the button         paddingHorizontal: 30, // Horizontal padding inside the button         shadowColor: "black", // Shadow color for iOS         shadowOffset: { width: 2, height: 2 }, // Shadow offset for iOS         shadowRadius: 15, // Shadow radius for iOS         shadowOpacity: 1, // Shadow opacity for iOS         elevation: 4, // Add shadow for Android     },     // Style for the text inside the submit button     submitButtonText: {         color: "white", // White text color         textAlign: "center", // Center align the text         fontSize: 18, // Medium font size     }, }); 


- TextInput: This component is used to take input from the user.

JavaScript
{ /* Website TextInput */} <TextInput     style={styles.input}     placeholder="Website"     value={website}     onChangeText={(text) => setWebsite(text)}  />  { /* Username TextInput */} <TextInput     style={styles.input}     placeholder="Username"     value={username}     onChangeText={(text) => setUsername(text)}  />  { /* Password TextInput */} <TextInput     style={styles.input}     placeholder="Password"     secureTextEntry={true}     value={password}     onChangeText={(text) => setPassword(text)}  /> 


- Add/Update Button: To achieve button function we are using TouchableOpacity component and changes the foreground text with respect to state of variable "editing".

JavaScript
{/* Button to save or update password */} <TouchableOpacity     style={styles.submitButton}     onPress={savePassword}>     <Text style={styles.submitButtonText}>         {editing? "Update Password"             : "Add Password"}     </Text> </TouchableOpacity> 


- Text: This component is used to display text on screen.

JavaScript
{/* Heading */} <Text style={styles.heading}>     Password Manager </Text>  {/* Subheading and alert */} <Text style={styles.subHeading}>     Your Passwords     {alertVisible && (         <Text id="alert"> (Copied!)</Text>     )} </Text> 


- Password UI: The Below code is used to display

  • "No Data To Show" - when no password is available, Or
  • website, username, and password - when the password is available with the help of the renderPasswordList function.
JavaScript
{/* Display message if no passwords are available */} {passwords.length === 0 ? (     <Text style={styles.noData}>         No Data To Show     </Text> ) : (     <ScrollView horizontal>         <View style={styles.table}>             {renderPasswordList()}         </View>     </ScrollView> )} 


- renderPasswordList: This function is used to display a list of saved passwords.

JavaScript
// Function to render the list of saved passwords const renderPasswordList = () => { return passwords.map((item, index) => (     <View style={styles.passwordItem} key={index}>         {/* Display website */}         <View style={styles.listItem}>             <Text style={styles.listLabel}>                 Website:             </Text>             <Text style={styles.listValue}>                 {item.website + " "}             </Text>             <TouchableOpacity                 style={styles.copyIcon}                 onPress={() => copyText(item.website)}>                 <Icon                     name="copy"                     size={20}                     color="#555" />             </TouchableOpacity>         </View>          {/* Display username */}         <View style={styles.listItem}>             <Text style={styles.listLabel}>                 Username:             </Text>             <Text style={styles.listValue}>                 {item.username + " "}             </Text>             <TouchableOpacity                 style={styles.copyIcon}                 onPress={() => copyText(item.username)}>                 <Icon                     name="copy"                     size={20}                     color="#555" />             </TouchableOpacity>         </View>          {/* Display masked password */}         <View style={styles.listItem}>             <Text style={styles.listLabel}>                 Password:             </Text>             <Text style={styles.listValue}>                 {maskPassword(item.password)}             </Text>             <TouchableOpacity                 style={styles.copyIcon}                 onPress={() => copyText(item.password)}>                 <Icon                     name="copy"                     size={20}                     color="#555" />             </TouchableOpacity>         </View>          {/* Buttons for editing and deleting */}         <View style={styles.buttonsContainer}>             <TouchableOpacity                 style={styles.editButton}                 onPress={() => editPassword(index)}>                 <Icon                     name="edit"                     size={20}                     color="#fff" />             </TouchableOpacity>             <TouchableOpacity                 style={styles.deleteButton}                 onPress={() => deletePassword(item.website)}>                 <Icon                     name="trash"                     size={20}                     color="white" />             </TouchableOpacity>         </View>     </View> )); }; 


- All Functions: Let's explore the list of functions used in our app.

Function

Description

savePassword

Used to save or update a password

editPassword

Used to enable editing mode for a specific password

deletePassword

Used to delete a password by website name

showPasswords

Used to reset the password list and input fields

copyText

Used to copy text to the clipboard

maskPassword

Used to mask a password with asterisks

Code:

JavaScript
 // Function to save or update a password const savePassword = () => {     // Check if any of the input fields is empty     if (!website || !username || !password) {         alert("Please fill in all fields."); // Show alert if fields are empty         return;     }      if (editing && editIndex !== null) {         // If editing, update the existing password         const updatedPasswords = [...passwords];         updatedPasswords[editIndex] = {             website,             username,             password,         };         setPasswords(updatedPasswords); // Update the password list         setEditing(false); // Exit editing mode         setEditIndex(null); // Clear edit index     } else {         // If not editing, add a new password         const newPassword = {             website,             username,             password,         };         setPasswords([...passwords, newPassword]); // Add new password to the list     }     setWebsite(""); // Reset website input     setUsername(""); // Reset username input     setPassword(""); // Reset password input };   // Function to enable editing mode for a specific password const editPassword = (index) => {     setEditing(true); // Enable editing mode     setEditIndex(index); // Set the index of the password being edited     setWebsite(passwords[index].website); // Populate website input with existing value     setUsername(passwords[index].username); // Populate username input with existing value     setPassword(passwords[index].password); // Populate password input with existing value };  // Function to delete a password by website name const deletePassword = (website) => {     const updatedPasswords = passwords.filter(         (e) => e.website !== website // Filter out the password with the given website     );     setPasswords(updatedPasswords); // Update the password list     alert(`Successfully deleted ${website}'s password`); // Show success message };  // Function to reset the password list and input fields const showPasswords = () => {     setPasswords([]); // Clear the password list     setWebsite(""); // Reset website input     setUsername(""); // Reset username input     setPassword(""); // Reset password input     setEditing(false); // Exit editing mode     setEditIndex(null); // Clear edit index };   // Function to copy text to the clipboard const copyText = async (txt) => {     try {         Clipboard.setString(txt); // Copy text to clipboard         setAlertVisible(true); // Show alert         setTimeout(() => {             setAlertVisible(false); // Hide alert after 2 seconds         }, 2000);     } catch (error) {         console.error("Error copying text:", error); // Log error if copying fails     } };  // Function to mask a password with asterisks const maskPassword = (pass) => {     let str = "";     for (let index = 0; index < pass.length; index++) {         str += "*";     }     return str; }; 


- useState: Used to manage State variables like input fields and password lists.

JavaScript
// State variables for managing input fields and password list const [website, setWebsite] = useState(""); // State for website input const [username, setUsername] = useState(""); // State for username input const [password, setPassword] = useState(""); // State for password input const [passwords, setPasswords] = useState([]); // State for storing list of passwords const [alertVisible, setAlertVisible] = useState(false); // State for showing alert when text is copied const [editing, setEditing] = useState(false); // State for tracking if editing mode is active const [editIndex, setEditIndex] = useState(null); // State for tracking the index of the password being edited 


- useEffect: Used to initialize the password list when the component mounts by calling the showPasswords function.

JavaScript
// useEffect hook to initialize the password list when the component mounts useEffect(() => {     showPasswords(); }, []); 


Now, wrap the two TextInputs, Texts, and TouchableOpacity components with a View component, and again wrap with ScrollView to achieve scroll functionality and return from the App component. Also, ensure to export the App.

Complete Source Code

App.js:

App.js
// Importing necessary hooks from React import {     useState, // Hook for managing state in functional components     useEffect // Hook for performing side effects in functional components } from "react";  // Importing components and utilities from React Native import {     View, // Container component for layout     Text, // Component for displaying text     TextInput, // Component for user input fields     TouchableOpacity, // Component for touchable buttons     ScrollView, // Component for scrollable views     StyleSheet, // Utility for creating styles     Clipboard, // Utility for interacting with the clipboard } from "react-native";  // Importing Icon component from react-native-vector-icons for displaying icons import Icon from "react-native-vector-icons/FontAwesome";   const App = () => {     // State variables for managing input fields and password list     const [website, setWebsite] = useState(""); // State for website input     const [username, setUsername] = useState(""); // State for username input     const [password, setPassword] = useState(""); // State for password input     const [passwords, setPasswords] = useState([]); // State for storing list of passwords     const [alertVisible, setAlertVisible] = useState(false); // State for showing alert when text is copied     const [editing, setEditing] = useState(false); // State for tracking if editing mode is active     const [editIndex, setEditIndex] = useState(null); // State for tracking the index of the password being edited      // useEffect hook to initialize the password list when the component mounts     useEffect(() => {         showPasswords();     }, []);       // Function to save or update a password     const savePassword = () => {         // Check if any of the input fields is empty         if (!website || !username || !password) {             alert("Please fill in all fields."); // Show alert if fields are empty             return;         }          if (editing && editIndex !== null) {             // If editing, update the existing password             const updatedPasswords = [...passwords];             updatedPasswords[editIndex] = {                 website,                 username,                 password,             };             setPasswords(updatedPasswords); // Update the password list             setEditing(false); // Exit editing mode             setEditIndex(null); // Clear edit index         } else {             // If not editing, add a new password             const newPassword = {                 website,                 username,                 password,             };             setPasswords([...passwords, newPassword]); // Add new password to the list         }         setWebsite(""); // Reset website input         setUsername(""); // Reset username input         setPassword(""); // Reset password input     };       // Function to enable editing mode for a specific password     const editPassword = (index) => {         setEditing(true); // Enable editing mode         setEditIndex(index); // Set the index of the password being edited         setWebsite(passwords[index].website); // Populate website input with existing value         setUsername(passwords[index].username); // Populate username input with existing value         setPassword(passwords[index].password); // Populate password input with existing value     };      // Function to delete a password by website name     const deletePassword = (website) => {         const updatedPasswords = passwords.filter(             (e) => e.website !== website // Filter out the password with the given website         );         setPasswords(updatedPasswords); // Update the password list         alert(`Successfully deleted ${website}'s password`); // Show success message     };      // Function to reset the password list and input fields     const showPasswords = () => {         setPasswords([]); // Clear the password list         setWebsite(""); // Reset website input         setUsername(""); // Reset username input         setPassword(""); // Reset password input         setEditing(false); // Exit editing mode         setEditIndex(null); // Clear edit index     };       // Function to copy text to the clipboard     const copyText = async (txt) => {         try {             Clipboard.setString(txt); // Copy text to clipboard             setAlertVisible(true); // Show alert             setTimeout(() => {                 setAlertVisible(false); // Hide alert after 2 seconds             }, 2000);         } catch (error) {             console.error("Error copying text:", error); // Log error if copying fails         }     };      // Function to mask a password with asterisks     const maskPassword = (pass) => {         let str = "";         for (let index = 0; index < pass.length; index++) {             str += "*";         }         return str;     };       // Function to render the list of saved passwords     const renderPasswordList = () => {         return passwords.map((item, index) => (             <View style={styles.passwordItem} key={index}>                 {/* Display website */}                 <View style={styles.listItem}>                     <Text style={styles.listLabel}>                         Website:                     </Text>                     <Text style={styles.listValue}>                         {item.website + " "}                     </Text>                     <TouchableOpacity                         style={styles.copyIcon}                         onPress={() => copyText(item.website)}>                         <Icon                             name="copy"                             size={20}                             color="#555" />                     </TouchableOpacity>                 </View>                  {/* Display username */}                 <View style={styles.listItem}>                     <Text style={styles.listLabel}>                         Username:                     </Text>                     <Text style={styles.listValue}>                         {item.username + " "}                     </Text>                     <TouchableOpacity                         style={styles.copyIcon}                         onPress={() => copyText(item.username)}>                         <Icon                             name="copy"                             size={20}                             color="#555" />                     </TouchableOpacity>                 </View>                  {/* Display masked password */}                 <View style={styles.listItem}>                     <Text style={styles.listLabel}>                         Password:                     </Text>                     <Text style={styles.listValue}>                         {maskPassword(item.password)}                     </Text>                     <TouchableOpacity                         style={styles.copyIcon}                         onPress={() => copyText(item.password)}>                         <Icon                             name="copy"                             size={20}                             color="#555" />                     </TouchableOpacity>                 </View>                  {/* Buttons for editing and deleting */}                 <View style={styles.buttonsContainer}>                     <TouchableOpacity                         style={styles.editButton}                         onPress={() => editPassword(index)}>                         <Icon                             name="edit"                             size={20}                             color="#fff" />                     </TouchableOpacity>                     <TouchableOpacity                         style={styles.deleteButton}                         onPress={() => deletePassword(item.website)}>                         <Icon                             name="trash"                             size={20}                             color="white" />                     </TouchableOpacity>                 </View>             </View>         ));     };      // Main component rendering     return (         <ScrollView style={styles.container}>             <View style={styles.content}>                 {/* Heading */}                 <Text style={styles.heading}>                     Password Manager                 </Text>                  {/* Subheading and alert */}                 <Text style={styles.subHeading}>                     Your Passwords                     {alertVisible && (                         <Text id="alert"> (Copied!)</Text>                     )}                 </Text>                  {/* Display message if no passwords are available */}                 {passwords.length === 0 ? (                     <Text style={styles.noData}>                         No Data To Show                     </Text>                 ) : (                     <ScrollView horizontal>                         <View style={styles.table}>                             {renderPasswordList()}                         </View>                     </ScrollView>                 )}                  {/* Form for adding or editing passwords */}                 <Text style={styles.subHeading}>                     {editing                         ? "Edit Password"                         : "Add a Password"}                 </Text>                 <TextInput                     style={styles.input}                     placeholder="Website"                     value={website}                     onChangeText={(text) => setWebsite(text)} />                  <TextInput                     style={styles.input}                     placeholder="Username"                     value={username}                     onChangeText={(text) => setUsername(text)} />                  <TextInput                     style={styles.input}                     placeholder="Password"                     secureTextEntry={true}                     value={password}                     onChangeText={(text) => setPassword(text)} />                  {/* Button to save or update password */}                 <TouchableOpacity                     style={styles.submitButton}                     onPress={savePassword}>                     <Text style={styles.submitButtonText}>                         {editing                             ? "Update Password"                             : "Add Password"}                     </Text>                 </TouchableOpacity>             </View>         </ScrollView>     ); }; // Exporting the main App component as the default export export default App;  // Defining styles for the application using StyleSheet const styles = StyleSheet.create({     // Style for the main container     container: {         flex: 1, // Take up the full height of the screen         margin: 20, // Add margin around the container     },     // Style for the content inside the container     content: {         margin: 15, // Add margin inside the content     },     // Style for the main heading     heading: {         fontSize: 30, // Large font size         fontWeight: "bold", // Bold text         marginBottom: 15, // Space below the heading         textAlign: "center", // Center align the text         color: "#333", // Dark gray color     },     // Style for subheadings     subHeading: {         fontSize: 23, // Slightly smaller font size than the main heading         fontWeight: "bold", // Bold text         marginBottom: 10, // Space below the subheading         color: "#333", // Dark gray color     },     // Style for the "No Data" message     noData: {         fontSize: 17, // Medium font size         fontStyle: "italic", // Italic text         marginBottom: 20, // Space below the message         color: "#666", // Light gray color     },     // Style for the table containing password items     table: {         flexDirection: "row", // Arrange items in a row         backgroundColor: "white", // White background         borderRadius: 15, // Rounded corners         elevation: 4, // Add shadow for Android         marginBottom: 20, // Space below the table         shadowColor: "grey", // Shadow color for iOS         shadowOffset: { width: 0, height: 0 }, // Shadow offset for iOS         shadowRadius: 5, // Shadow radius for iOS         shadowOpacity: 1, // Shadow opacity for iOS     },     // Style for each password item     passwordItem: {         flexDirection: "column", // Arrange items in a column         alignItems: "center", // Center align items         borderBottomWidth: 1, // Add a bottom border         borderBottomColor: "#ddd", // Light gray border color         padding: 15, // Add padding inside the item     },     // Style for each list item (e.g., website, username, password)     listItem: {         flexDirection: "row", // Arrange items in a row         justifyContent: "space-between", // Space out items evenly         alignItems: "center", // Center align items vertically         marginRight: 10, // Space to the right of the item         marginBottom: 10, // Space below the item     },     // Style for the label in the list item     listLabel: {         fontWeight: "bold", // Bold text         marginBottom: 5, // Space below the label         color: "#333", // Dark gray color         fontSize: 19, // Medium font size     },     // Style for the value in the list item     listValue: {         flex: 1, // Take up available space         fontSize: 18, // Medium font size         color: "#444", // Medium gray color         paddingLeft: 10, // Space to the left of the value     },     // Style for the copy icon in the list item     copyIcon: {         marginRight: 10, // Space to the right of the icon         paddingLeft: 10, // Space to the left of the icon     },     // Style for the delete button     deleteButton: {         backgroundColor: "red", // Red background         borderRadius: 4, // Slightly rounded corners         padding: 5, // Add padding inside the button         marginLeft: 10, // Space to the left of the button     },     // Style for the edit button     editButton: {         backgroundColor: "blue", // Blue background         borderRadius: 4, // Slightly rounded corners         padding: 5, // Add padding inside the button         marginRight: 10, // Space to the right of the button     },     // Style for the container holding the edit and delete buttons     buttonsContainer: {         flexDirection: "row", // Arrange buttons in a row     },     // Style for the input fields     input: {         borderWidth: 2, // Border width         borderColor: "#eee", // Light gray border color         paddingVertical: 10, // Vertical padding inside the input         paddingHorizontal: 15, // Horizontal padding inside the input         marginBottom: 20, // Space below the input         fontSize: 16, // Medium font size         borderRadius: 10, // Rounded corners         backgroundColor: "white", // White background         shadowColor: "grey", // Shadow color for iOS         shadowOffset: { width: 0, height: 0 }, // Shadow offset for iOS         shadowRadius: 10, // Shadow radius for iOS         shadowOpacity: 1, // Shadow opacity for iOS         elevation: 4, // Add shadow for Android     },     // Style for the submit button     submitButton: {         backgroundColor: "green", // Green background         color: "white", // White text color         fontWeight: "bold", // Bold text         borderRadius: 10, // Rounded corners         paddingVertical: 15, // Vertical padding inside the button         paddingHorizontal: 30, // Horizontal padding inside the button         shadowColor: "black", // Shadow color for iOS         shadowOffset: { width: 2, height: 2 }, // Shadow offset for iOS         shadowRadius: 15, // Shadow radius for iOS         shadowOpacity: 1, // Shadow opacity for iOS         elevation: 4, // Add shadow for Android     },     // Style for the text inside the submit button     submitButtonText: {         color: "white", // White text color         textAlign: "center", // Center align the text         fontSize: 18, // Medium font size     }, }); 

Output



Next Article
Create a Blog App using React-Native

S

saurabhkumarsharma05
Improve
Article Tags :
  • Project
  • Web Technologies
  • Android
  • ReactJS
  • Geeks Premier League
  • React-Native
  • Web Tech - Advanced
  • Geeks Premier League 2023

Similar Reads

    React Native Tutorial
    React Native is a framework developed by Facebook for creating native-style applications for Android & iOS under one common language, i.e. JavaScript. Initially, Facebook only developed React Native to support iOS. However, with its recent support of the Android operating system, the library can
    5 min read

    React Native Basics

    Introduction to React Native
    If you want to build mobile apps for both Android and iOS. What should you learn? The individual native languages for each app i.e, Java for Android and Swift/Objective-C for iOS?, Actually NO. Native Android and iOS development are quite different and can be expensive – first, the language itself i
    3 min read
    What are the steps to create first React Native App ?
    React Native is an open-source UI software framework created by Meta Platforms, Inc. It is used to develop applications for Android, Android TV, iOS, etc. We’re always looking for shorter development cycles, quicker time to deployment, and better app performance. And there are so many hybrid mobile
    4 min read
    How React Native works
    React Native is a popular framework for building mobile applications using JavaScript and React. It allows developers to write code once in JavaScript and run it on both Android and iOS devices, bridging the gap between web and native mobile development. In this article, we’ll explore the main compo
    5 min read
    What is a bridge in React Native ?
    A React Native app comprises two sides as given below.The JavaScript SideThe Native SideThe Native Side should be Java or Kotlin for Android and Swift or Objective-C for iOS.The huge reason for the popularity of React Native is that a bridge can be created between the JavaScript code and Native lang
    7 min read
    How React Native is different from ReactJS ?
    In this article, we will learn about how React Native is different from ReactJS. Both are popular JavaScript libraries. ReactJS is primarily used for building user interfaces on the web, while React Native extends its capabilities to mobile app development.React JSIt is a JavaScript library that sup
    4 min read
    React Native Debugging
    Debugging is very important for building applications and removing errors. A good knowledge of debugging techniques allows for the faster and efficient development of software.Here we are going to discuss a few debugging techniques in React Native. We will be using expo-cli to develop, run, and debu
    4 min read

    React Native Components

    How to import components in React Native ?
    React Native is a framework developed by Facebook for creating native-style applications for Android & iOS under one common language, i.e. JavaScript. Initially, Facebook only developed React Native to support iOS. However, with its recent support of the Android operating system, the library can
    5 min read
    React Native ListView Component
    The ListView Component is an inbuilt React Native view component that displays a list of items in a vertically scrollable list. It requires a ListView.DataSource API to populate a simple array of data blobs and instantiate the ListView component with a data source and a renderRow callback.The major
    4 min read
    React Native ScrollView Component
    The ScrollView Component is an inbuilt react-native component that serves as a generic scrollable container, with the ability to scroll child components and views inside it. It provides the scroll functionality in both directions- vertical and horizontal (Default: vertical). It is essential to provi
    8 min read
    React Native Tab Navigation Component
    In this article, we are going to see how to implement Tab Navigation in react-native. For this, we are going to use createBottomTabNavigator component. It is basically used for navigation from one page to another. These days mobile apps are made up of a single screen, so create various navigation co
    3 min read
    React Native Drawer Navigation Component
    In this article, we’re going to explore how to implement Drawer Navigation in a React Native application. We'll be using the createDrawerNavigator component, which serves as a convenient UI panel for displaying your navigation menu. By default, this panel is hidden, but it gracefully slides into vie
    3 min read
    React Native ActivityIndicator Component
    In this article, we’re going to explore how to create an ActivityIndicator in React Native. If you’ve ever wanted to show a loading spinner while your app is processing something, the ActivityIndicator component is just what you need. It’s designed to display a circular loading indicator that lets y
    2 min read
    Dumb Components in React Native
    In this article, we are going to learn about Dumb components in React Native. The dumb component is one of the categories of React Components, so before diving into the dumb component details. Let's know a little bit about components. A Component is one of the core building blocks of React. The comp
    5 min read
    What is the TouchableHighlight in react native ?
    TouchableHighlight is a component that is used to provide a wrapper to Views to make them respond correctly to touch-based input. On press down the TouchableHighlight component has its opacity decreased which allows the underlying View or other component's style to get highlighted.This component mus
    4 min read
    React Native FlatList Component
    FlatList is a React Native component that is a scrolling list that shows changing information while keeping the same look. It's great for long lists where the number of items can change. Instead of loading all items simultaneously, this component only shows what you can see on the screen. This makes
    4 min read
    React Native AsyncStorage Component
    Here is a guide on how to use AsyncStorage in React Native. We will use the AsyncStorage component. AsyncStorage is an unencrypted, asynchronous, persistent key-value storage system that is accessible globally throughout the app.SyntaxAsyncStorage.method();Methods in AsyncStorageMethodDescriptionget
    5 min read
    React Native Button Component
    The following approach covers how to use the Button in react-native. For this, we are going to use the Button component. It is basically a clickable component that is used to perform some action when clicked by the user. Let's watch a demo video of what we are going to develop.Demo Video:Syntax<B
    6 min read

    React Native UI Elements

    How to style React Native Application ?
    In this article, we'll learn how to style React Native applications. There are two major ways to style your React Native Application.Table of ContentStyle PropsUsing StyleSheetStyle Props ExampleUsing StyleSheet ExampleStyle PropsTo style an element with the style props, the value must be a JavaScri
    5 min read
    How to create a basic button in React Native ?
    In this article, we will learn how to create a basic button in React Native. To build a React Native app, we will use the Expo CLI, which provides a smoother experience for running your applications.ExpoIt is a framework and a platform for universal React applications. It is a set of tools and servi
    5 min read
    How to Implement Radio Button In React Native ?
    In this article, we will learn to implement a Radio Button in React Native. A radio button signifies a graphical user interface­ element enabling individuals to make an exclusive se­lection among multiple alternative­s. React Native is a popular platform for creating native mobile apps for iOS and A
    10 min read
    How to create a table in react-native ?
    React native is a framework developed by Facebook for creating native-style apps for iOS & Android under one common language, JavaScript. Initially, Facebook only developed React Native to support iOS. However, with its recent support of the Android operating system, the library can now render m
    2 min read
    How to add SearchBar in React Native ?
    In this article, we'll add search functionality in React-Native. This can be regarded as a continuation of the React native flatlist component. In the article above, we created a flatlist using the Flatlist component. Let's make it searchable using the SearchBar component. To add a SearchBar to your
    13 min read
    React Native Animated Fade In Fade Out Effect
    In this article, we will dwell on the implementation of fade­-in and fade-out effects in Re­act Native using the Animated module­.The fade­-in and fade-out effect, a time­less animation technique utilize­d to seamlessly transition an ele­ment from invisibility to visibility and vice versa, holds a s
    8 min read
    How to set Background Image in react-native ?
    In this article, we will see how to set background Image in react-native. In our project, we will simply set a background image and show a text input on top of it. Setting background images requires using the ImageBackground component in React Native. You can style it further to adapt to different s
    5 min read
    How to create custom FAB(Floating Action Button) in React Native?
    React Native doesn't come with any FAB component built in. A floating action button (FAB) is used whenever you want to display a button on top of everything. If you have used ScrollView and the user can scroll up and down, this FAB button will always stay at the same position and doesn't move with t
    7 min read
    How to add a Progress Bar in react-native using react-native-paper library ?
    In this article, we’re going to create a progress bar using material design. We’ll be using the react-native-paper library to display this progress bar. The progress bar will act as a status indicator, showing how much progress has been made. In our project, we will place the progress bar at the top
    10 min read
    How to create Avatar in react-native ?
    In this article, we will create 3 different kinds of Avatars using the react-native-paper library. An avatar is used for representation purposes in the form of icons, images, or text. In our project, we will create all these Avatars using material design. To give you a better idea of what we’re goin
    6 min read

    React Native API

    React Native Switch API
    In this article, we will explore how to use the Switch component in React Native. The Switch component is a controlled component, meaning it requires a callback function to update the props based on the user's actions. Let's watch a demo video of what we are going to develop.Demo VideoSyntax<Swit
    6 min read
    React Native Alert API
    In this article, we will explore how to create an alert in React Native using the React Native Alert API. This API enables the display of a small pop-up window that prompts the user for a choice.The Alert API utilizes the alert method to present the alert dialog box. This dialog box can include thre
    6 min read

    React Native Questions

    Find what caused Possible unhandled promise rejection in React Native ?
    In this article, we will check out the `Possible Unhandled Promise Rejection` error in react native.Step-by-Step ImplementationStep 1: Create a React Native ProjectNow, create a project with the following command.npx create-expo-app app-name --templateNote: Replace the app-name with your app name fo
    5 min read
    Axios in React Native
    Axios is a widely used HTTP client for making REST API calls. You can use this in React Native to get data from any REST API.Axios in React NativeAxios is a library that helps you send HTTP requests in React Native apps. It allows mobile devices to communicate with a server, enabling them to send an
    8 min read
    How to fetch data from a local JSON file in React Native ?
    Fetching JSON (JavaScript Object Notation) data in React Native from Local (E.g. IOS/Android storage) is different from fetching JSON data from a server (using Fetch or Axios). It requires Storage permission for APP and a Library to provide Native filesystem access.Implementation: Now let’s start wi
    3 min read
    How to center a View component on screen ?
    The View Component is the basic building block for creating the user interface. It can map directly to the native view of different platforms, like UIView, <div>, android.view, etc. The View component can consist of nested View components as well as other native components (children).Approach:
    3 min read
    How to Add Icons at the Bottom of Tab Navigation in React Native ?
    Adding Icons at the Bottom of Tab Navigation in React Native is a fairly easy task. In this article, we will implement a basic application to learn to use icons in our tab navigation. For this, we first need to set up the application and install some packages.Implementation: Now let’s start with the
    3 min read
    How to pass value between Screens in React Native ?
    With React Navigation, we can also pass values or parameters between screens in React Native. We will create a simple stack navigator with 2 screens and pass values from one screen to another. Let’s watch a short video to see what we are going to create.Demo VideoStep-by-Step ImplementationStep 1: C
    6 min read
    How to make a Post request from frontend in react-native ?
    The POST method is used to send data to the server to create a new resource or modify an existing resource on the server. We cannot make a POST request by using a web browser, as web browsers only directly support GET requests.But what if we want to develop an application where we need to add some d
    9 min read
    How to add GIFs in react-native ?
    React-native is a cross-platform mobile application development tool. It is one of the frameworks built on top of Javascript. Now let's come to the point. We usually use .jpeg or .png images because we are more friendly to them. But what if you want to add GIF support to your react native project. T
    2 min read
    How to Implement Form Validation in React Native ?
    React Native is a JavaScript framework for cross-platform mobile app development. Expo CLI simplifies React Native development with a streamlined process and helpful tools. In this article, we'll see how to implement form validation in react native. Form validation ensures the validity of user input
    3 min read
    How many threads run in a React Native app ?
    If you want to be a react native developer and have mastered creating basic android and ios apps, then one of the most important things is to learn the execution process of threads. If you understand how a react native app executes and how many threads it uses that will help you build more efficient
    3 min read
    How to add Table in React Native ?
    React Native is an open-source UI software framework created by Meta Platforms, Inc. It is used to develop applications for Android, Android TV, iOS, macOS, tvOS, Web, Windows, and UWP by enabling developers to use the React framework along with native platform capabilities. In this article, we will
    2 min read
    How to add a Menu in react-native using Material Design ?
    In this article, we will see how to create a menu in react-native. To make a menu, we will use the material design library, i.e., react-native-paper. The menu contains a list of options that appear temporarily. In our project, we will create a button, and the menu will appear on the click of that bu
    9 min read
    What are props in React Native ?
    Props are used to provide properties to the components using which they can be modified and customized. These properties are passed to the components when the component is created. Props are used in both user-defined and default components to extend their functionality. These props are immutable and
    5 min read
    How to check the version of React native ?
    React Native is a mobile app framework to build natively-rendered apps based on JavaScript. To know the version of React Native (RN), we can use some simple ways. In this article, we will see four easy ways to find the react native version: Using TerminalUsing npxUsing package.jsonUsing the info opt
    2 min read
    How to perform logging in React Native ?
    In this article, we will learn about logging in React Native.LoggingIt is a quick and easy way to debug your application in development phase. It helps to get an insight into the functioning of the application. To perform logging, we can simply use the console.log() statements to log the required in
    4 min read
    How to Upload and Preview an Image in React Native ?
    Image uploading and previewing are widespread in mobile apps. With the Expo ImagePicker package, React Native makes this work easier. Uploading and previewing photographs is a common feature in Android and iOS applications, especially in the user profile section. This feature allows users to submit
    4 min read
    How to Add Phone Number Input in React Native ?
    React Native is a JavaScript framework for cross-platform mobile app development. In this article, we'll see how to add a phone number input field in a React Native app using Expo CLI.​Adding a phone number input field in React Native is helpful for collecting user phone numbers during registration
    3 min read
    How to Get Window Width and Height In React Native ?
    In this article, we'll explore two different approaches to obtaining the screen width and height in a React Native application. Scree­n dimensions, including width and height, play a vital role in de­signing user interfaces that adapt se­amlessly to different de­vices and orientations. By understand
    5 min read
    How to check Platform and Device Details in React Native ?
    React Native is an open-source UI software framework created by Meta Platforms, Inc. It is used to develop applications for Android, Android TV, iOS, macOS, tvOS, Web, Windows, and UWP by enabling developers to use the React framework along with native platform capabilities.In this article, we will
    3 min read
    Top React Native Apps to Build in 2025
    Top React Native Apps to Build in 2025 is a popular framework for building high-performance mobile apps using JavaScript and React. It allows developers to create apps for both iOS and Android with a single codebase, saving time and resources. React Native, developed by Facebook. Initially, for iOS,
    9 min read
    How to Create ToDo App using React Native ?
    In this article, we'll see how to create a To-Do app using React Native. An ideal illustration of a basic application that can be developed with React Native is a To-Do app. This app enables users to generate, modify, and remove tasks, assisting them in maintaining organization and concentration. To
    11 min read

    React Native Projects

    How to Generate Random Numbers in React Native ?
    Generating random numbers is a fundamental aspect of React Native development. It enables various functionalities like generating game elements, creating unique identifiers, and implementing randomized UI components. In this article, we are going to see how we can generate a random number by using R
    7 min read
    Build a Calculator using React Native
    Building a simple calculator app in React Native is an exciting project. You'll create an interface with buttons for numbers (0-9) and operations (+, -, ×, ÷), along with a display area for showing input and results. Using React Native, you'll write functions that handle button presses and perform c
    10 min read
    Create a Task Manager App using React-Native
    In this article, we'll walk you through the process of building a basic Task Manager app using React Native. The application enables users to effortlessly create, edit, complete/incomplete, and delete­ tasks, providing an uncomplicated yet impactful introduction to Re­act Native's mobile app develop
    12 min read
    How to Create Emoji Picker in React Native ?
    React Native is a popular cross-platform framework for mobile app development. Emojis have become common in modern applications, providing personalization and enhancing user engagement. In this article, we'll see how we can add an emoji picker to a React Native application.React Native doesn't have
    3 min read
    Create a Stop Watch using React Native
    Stopwatches serve as vital tools for accurately measuring time­ intervals. By the capabilities of React Native, we can effortle­ssly develop a versatile­ stopwatch application compatible with both iOS and Android devices. In this article, we­ will guide you through the step-by-step process of creati
    10 min read
    Create an OTP Generator and Validator App using React-Native
    One-time passwords (OTPs) have become a popular choice for enhancing the security of various online services and applications. In this article, we'll explore how to create an OTP Generator and Validator App using React Native, a popular framework for building cross-platform mobile applications.To gi
    11 min read
    Create a Rock Paper Scissors Game using React-Native
    Rock, Paper, Scissors is a timeless game that has entertained people of all ages for generations. In this article, we will walk you through the process of creating a Rock Paper Scissors mobile game using React Native. You'll learn how to build a simple yet engaging game that can be played on both An
    10 min read
    Create a Number Guessing App using React-Native
    The Number Guessing App is a simple mobile game where the user tries to guess a random number generated by the app. The app provides feedback to the user, indicating whether their guess is too high or too low, and keeps track of the number of attempts it takes to guess the correct number. In this ar
    10 min read
    Create a BMI Calculator App using React-Native
    In this article, we will create a BMI (Body Mass Index) calculator using React Native. A BMI calculator serves as a valuable and straightforward tool for estimating body fat by considering height and weight measurements.A BMI Calculator App built with React Native allows users to input their age, he
    4 min read
    Create a GPA Calculator using React Native
    A GPA calculator proves to be a useful tool for students who want to monitor their academic progress. In this article, we will build a GPA calculator using React Native, a popular framework for building mobile applications. To give you a better idea of what we’re going to create, let’s watch a demo
    15+ min read
    Create a Password Manager using React-Native
    This article will demonstrate how to create a Password Manager Application using React-Native. To assist users in securely storing and managing their passwords, we will develop a Password Manager mobile­ application using React Native for this project. The application will provide functionalities su
    15+ min read
    Create Jokes Generator App using React-Native
    In this article, we are going to build a joke generator app using react native. React Native enables you to master the­ designing an elegant and dynamic use­r interface while e­ffortlessly retrieving joke­s from external APIs. To give you a better idea of what we’re going to create, let’s watch a de
    8 min read
    Build a Dictionary App Using React Native
    In this article, we will implement a Dictionary app using React Native. The app allows users to effortlessly search for word meanings, access definitions, listen to pronunciations, and examine example sentences. To give you a better idea of what we’re going to create, let’s watch a demo video.Demo V
    15+ min read
    Create a Blog App using React-Native
    This article will help you make a simple blog app using React Native. The app lets users add, edit, and delete blog posts, making it easy to manage content. You will learn how to use different React Native features to create a user-friendly design that checks if the input is correct, making sure all
    15+ min read
    Create a Text Editor App using React-Native
    In this article, we are going to implement a text editor app using React Native. It will contain multiple text formatting functionalities like bold, italic, underline, etc. We will implement Editor with a library called "react-native-pell-rich-editor."Preview of final output: Let us have a look at h
    3 min read
    Create a Password Validator using React-Native
    In this article we are going to implement a Password Validator using React Native. The Password validation app in React Native is a simple application that is used to check the strength of a password. Passwords protect your personal and sensitive data, such as financial information, medical records,
    11 min read
    Create a Currency Converter using React-Native
    In this article, we will build a currency converter using react native. This app serves as a valuable tool for travelers, business professionals, and anyone who frequently deals with international currencies. It enables users to effortle­ssly convert one currency to another. To give you a better ide
    14 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences