How to add Floating Buttons in React Native ? Last Updated : 26 Jul, 2024 Comments Improve Suggest changes Like Article Like Report 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 be learning how to add Floating Buttons in React Native.Creating React Native App:Step 1: We'll be using the expo to create the react native app. Install expo-cli using the below command in the terminal.npm install -g expo-cliStep 2: Create a react native project using expo.expo init "gfg"Step 3: Now go to the created project using the below command.cd "gfg"Project Structure: It will look like the following.Creating Floating Button: We can easily add floating buttons in our react native app. For this, we are going to use the TouchableOpacity component of react-native. Example: Add the below code in the App.js file. JavaScript import React, { useState } from "react"; import { View, Text, TouchableOpacity } from "react-native"; const GfGApp = () => { return ( <View style={{ marginTop: 200 }}> <Text style={{ fontSize: 18 }}> GeeksforGeeks React Native Floating Button </Text> <TouchableOpacity style={{ borderWidth: 1, borderColor: 'red', alignItems: 'center', justifyContent: 'center', width: 70, position: 'absolute', top: 390, right: 20, height: 70, backgroundColor: 'red', borderRadius: 100, }} onPress={() => { alert('Button is pressed') }} > <Text style={{ color: "white" }}>Floating</Text> </TouchableOpacity> </View> ); }; export default GfGApp; Here first we are creating our floating button using the TouchableOpacity. Then we are adding styling to our button.Run the application: Now run the application using the below command in the terminal.npm run webOutput:You can see the output of the project below: Comment More infoAdvertise with us Next Article How to add Floating Buttons in React Native ? I imranalam21510 Follow Improve Article Tags : JavaScript Web Technologies React-Native Similar Reads How to create a Floating Action Button 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 Create Button in React-Native App ? React Native provides pre-defined components like button and TouchableOpacity to create buttons in a react native app. In this article, we will see how to create buttons in react-native, their syntax, and different types of buttons available in react-native.Table of ContentApproachButton in React Na 4 min read How to add Share button 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 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 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 create a Banner 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 3 min read How to Create a Button in Material UI ? Material UI provides a simple and effective way to create buttons in React applications. These offer a sleek and responsive user interface element for various interactions. Installation// Package containing Material UI components including buttons.npm install @mui/materialApproachImport the Button c 1 min read How to use Flexbox in React Native ? Flexbox is used to provide consistency to a layout. It is used to make the layout adaptive to the screen size of the device it is running on. Using flexbox design you can specify that a certain element of layout will span to this fraction of the available space. In React Native, Flexbox is the same 3 min read React MUI Floating Action Button React MUI is a UI library that provides fully-loaded components, bringing our own design system to our production-ready components. MUI is a user interface library that provides predefined and customizable React components for faster and easy web development, these Material-UI components are based o 4 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 Like