New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-custom-buttons

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-custom-buttons

react native custom button based on pure JavaScript with good expansibility

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-45.45%
Maintainers
2
Weekly downloads
 
Created
Source

react-native-custom-buttons

react native custom button based on pure JavaScript with good expansibility.

Installation

npm install react-native-custom-buttons

Setup

If you want to use icons install react-native-vector-icons

npm install react-native-vector-icons

Buttons Component

Props

PropRequiredTypeDescription
onPressYesFunctionCallback function to be executed on button press.
containerStylesNoViewStyleCustom styles for the button container.
typeYes"Text", "SVG", or "vector Icon"Type of button. Choose one

iconProps

PropRequiredTypeDescription
fontFamilyYes'AntDesign', 'Entypo', ...Font family for the icon.
iconSizeNoNumberSize of the icon. Default is 20.
iconNameYesStringName of the icon.
iconColorYesColorValueColor of the icon.

textProps

PropRequiredTypeDescription
titleNoStringText content for the button.
textStyleNoTextStyleCustom styles for the text.

svgProps

PropRequiredTypeDescription
childrenNoReactNodeChild components for the SVG button.

loadingProps

PropRequiredTypeDescription
isLoadingNoBooleanIndicates if the button is in a loading state.
loaderColorNoColorValueColor of the loading indicator.
loaderSizeNoNumber or 'small' or 'large' or undefinedSize of the loading indicator. Default is small.

Example Usage

import Buttons from 'path/to/Buttons';

const IconButton = () => (
  <Buttons
    onPress={() => console.log('Icon button pressed')}
    type="vector Icon"
    fontFamily="FontAwesome"
    iconSize={30}
    iconName="star"
    iconColor="yellow"
  />
);

const TextButton = () => (
  <Buttons
    onPress={() => console.log('Text button pressed')}
    type="Text"
    title="Click me"
    textStyle={{ color: 'white' }}
  />
);

const SVGButton = () => (
  <Buttons
    onPress={() => console.log('SVG button pressed')}
    type="SVG"
  >
    {/* Your SVG component here */}
  </Buttons>
);

For a usage example, refer to the example directory in the repository.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Keywords

FAQs

Package last updated on 19 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc