1.0.2 • Published 1 year ago

expo-custom-button v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

expo-custom-button

expo-custom-button is a customizable and reusable button component for React Native

Installation

To install expo-custom-button, run:

npm install expo-custom-button

OR

yarn add expo-custom-button

Usage

// import here
import CustomButton from 'expo-custom-button';

// Basic Usage
<CustomButton
  text="Click me"
  onPress={() => console.log('Button clicked!')}
/>
PropTypeDefault ValueDescription
textstringButton
onPressfunctionFunction to call when the button is pressed
leftIconobjectObject containing information about the left icon
rightIconobjectObject containing information about the right icon
fontSizenumber16Font size for the button text
fontWeightstringboldFont weight for the button text
TextColorstringblackColor of the button text
backgroundColorstringlightblueBackground color of the button
borderRadiusstring5pxBorder radius for the button
widthstring or numberautoWidth of the button

Icons Prop Example:

The leftIcon and rightIcon props should be an object containing the uri property for remote image URLs, or a local image require statement. For example:

const leftIcon = {
  uri: 'https://example.com/left-icon.png'
};

const rightIcon = require('./right-icon.png');

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

CustomButton is released under the MIT License. See LICENSE for details.