Open In App

Clipboard App using React-Native

Last Updated : 24 Apr, 2025
Comments
Improve
Suggest changes
4 Likes
Like
Report

In this tutorial, we will create a stylish clipboard app using React Native. The app allows users to copy text to the clipboard, paste text from the clipboard, and display a stylish popup message to indicate successful copy or paste actions.

Preview of final output: Let us have a look at how the final application will look like.

final
Final Output

Prerequisites:

Approach:

The Clipboard App will have the following functionalities:

  • Copy Text to Clipboard: Users can enter text into an input field and click the "Copy" button to copy the text to the clipboard.
  • Paste Text from Clipboard: Users can click the "Paste" button to paste text from the clipboard into the input field.
  • Stylish Popup: After a successful copy or paste action, a stylish modal popup will appear with a relevant message.

Steps to Create the Clipboard App:

Step 1: Create a new Expo project

npx create-expo-app Clipboard-App
cd ClipboardApp

Step 2: Install dependencies

npm install react-native-modal
expo install expo-clipboard

Step 3: Create the main component

Create a new file ClipboardApp.js and define the main component with the desired functionalities.

Project Structure:

folder
Folder Structure

The updated dependencies in package.json file will look like :

"dependencies": {
"react-native-paper": "*",
"@expo/vector-icons": "^13.0.0",
"expo-status-bar": "~1.6.0",
"expo-contacts": "~12.2.0",
"expo-permissions": "~14.2.1",
"react-native-screens": "~3.22.0",
"react-native-contacts": "^7.0.8",
"@react-navigation/stack": "^6.3.20",
"@react-navigation/native": "6.0.0",
"react-native-permissions": "^4.0.0",
"react-native-gesture-handler": "~2.12.0",
"react-native-safe-area-context": "4.6.3",
"expo-clipboard": "~4.3.1",
"react-native-modal": "*"
}

Example: Below is the code example for the clipboard app.

JavaScript
//App.js
import React from "react";
import ClipboardApp from "./ClipboardApp"; // Import the ClipboardApp component
import { StatusBar } from "expo-status-bar";
import { StyleSheet, View } from "react-native";

export default function App() {
    return (
        <View style={styles.container}>
            {/* Render the ClipboardApp component */}
            <ClipboardApp />
            <StatusBar style="auto" />
        </View>
    );
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: "#fff",
        alignItems: "center",
        justifyContent: "center",
    },
});
JavaScript

Steps to Run the Application:

Step 1: Navigate to the project directory.

cd Clipboard-App

Step 2: Run

expo start

Output:

Finaloutput
Final Output

Next Article

Similar Reads