npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sp-react-native-iconbutton

v2.29.1

Published

A React Native button that can also have an `icon` within it through the `iconProps` property.

Downloads

8

Readme

sp-react-native-iconbutton

A React Native button that can also have an icon within it through the iconProps property.

It works both WITH an icon AND without so it can cover all your button needs.

Renders a TouchableOpacity under iOS and a TouchableNativeFeedback under Android.

Install

sp-react-native-iconbutton needs React Native 0.16 or higher.

Install the package:

$ npm i sp-react-native-iconbutton --save

Import the Button component:

import Button from 'sp-react-native-iconbutton'

###Caution: This library is now compatible for react-native 29 and onwards. Thats because it uses the ActivityIndicator which does not exist in previous versions of react-native. If you wish to run it in previous react-native versions you will have to use the branch called pre29.

Usage

Provide TouchableWithoutFeedback' props to the component (including style), textStyle's StyleSheet to customize the inner text and a children node to render. You can also provide the isLoading prop that will dim the button and disable it to prevent accidental taps.

<Button
    style={{backgroundColor: '#3D5B96', height:60, borderRadius: 4, borderWidth: 1, borderColor: 'rgba(0,0,0,0.2)'}}
    textStyle={{color: 'white', textAlign: 'center'}}
    iconProps={{name: "facebook",size:25, color: "white"}}
    iconStyle={{paddingHorizontal:20}}
>
    Login with Facebook
</Button>

API

| Prop | Type | Description | |------|------|-------------| | onPress | func | Function to execute when the onPress event is triggered. | | onPressIn | func | Function to execute when the onPressIn event is triggered. | | onPressOut | func | Function to execute when the onPressOut event is triggered. | | onLongPress | func | Function to execute when the onLongPress event is triggered. | | customIcon | func | A function that returns a custom React element that will serve as the icon. (If you use that, you should NOT use iconProps or iconStyle) | | iconContainerStyle | ViewStylePropTypes | The StyleSheet to apply to the view that contains our icon be it a custom icon or a default (FontAwesome) icon. | | iconStyle | ViewStylePropTypes | The StyleSheet to apply to the inner button text. (If you use that, you should NOT use customIcon) | | iconProps | Object | If you pass iconProps you're actually telling the Button to create a FontAwesome icon, and you then pass those props to that icon. The properties to pass to your (FontAwesome) icon. You can pass any prop that you could pass on react-native-vector-icons (If you use that, you should NOT use customIcon) | | textStyle | TextStylePropTypes | The StyleSheet to apply to the inner button text. | | disabledStyle | TextStylePropTypes | The StyleSheet to apply when disabled. | | children | string | The string to render as the text button. | | isLoading | bool | Renders an inactive state dimmed button with a spinner if true. | | isDisabled | bool | Renders an inactive state dimmed button if true. | | activityIndicatorColor | string | Sets the button of the ActivityIndicatorIOS or ProgressBarAndroid in the loading state. | | background | TouchableNativeFeedback.propTypes.background | Android only. The background prop of TouchableNativeFeedback. |

License

MIT.