More Premium Hugo Themes Premium React Themes

React Native Button

A React Native button component customizable via props

React Native Button

A React Native button component customizable via props

Author Avatar Theme by apsl
Github Stars Github Stars: 744
Last Commit Last Commit: Apr 24, 2018 -
First Commit Created: Feb 24, 2024 -
React Native Button screenshot

Overview

The apsl-react-native-button is a customizable React Native button component that renders a TouchableOpacity under iOS and a TouchableNativeFeedback under Android. It provides various props for customization, including styling options and event handling functions.

Features

  • Customizable Styling: Customize the button’s style using style props.
  • Cross-Platform Compatibility: Renders as a TouchableOpacity for iOS and TouchableNativeFeedback for Android.
  • Event Handling: Execute functions for onPress, onPressIn, onPressOut, onLongPress events.
  • Text Customization: Customize the inner text styling using the textStyle prop.
  • Loading State: Disable the button and show a spinner with the isLoading prop.
  • Child Elements: Use multiple child elements for nested content inside the button.
  • Accessibility: Control button transparency, activity indicator color, and disabled style.

Installation

To install the apsl-react-native-button package, ensure you have the correct React Native version:

  • For versions >=2.6.0, require React Native 0.28 or higher.
  • For versions >=2.5.0, require React Native 0.25 or higher.
  • For versions <=2.4.2, require React Native 0.16 or higher.

Install the package:

npm install apsl-react-native-button

Import the Button component:

import Button from 'apsl-react-native-button';

Summary

The apsl-react-native-button is a versatile button component for React Native applications that offers customization options for styling, event handling, and text customization. It supports cross-platform rendering for iOS and Android, making it a suitable choice for building interactive and visually appealing buttons in mobile apps.