
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
react-native-custom-buttons
Advanced tools
react native custom button based on pure JavaScript with good expansibility
react native custom button based on pure JavaScript with good expansibility.
npm install react-native-custom-buttons
If you want to use icons install react-native-vector-icons
npm install react-native-vector-icons
Prop | Required | Type | Description |
---|---|---|---|
onPress | Yes | Function | Callback function to be executed on button press. |
containerStyles | No | ViewStyle | Custom styles for the button container. |
type | Yes | "Text" , "SVG" , or "vector Icon" | Type of button. Choose one |
Prop | Required | Type | Description |
---|---|---|---|
fontFamily | Yes | 'AntDesign' , 'Entypo' , ... | Font family for the icon. |
iconSize | No | Number | Size of the icon. Default is 20 . |
iconName | Yes | String | Name of the icon. |
iconColor | Yes | ColorValue | Color of the icon. |
Prop | Required | Type | Description |
---|---|---|---|
title | No | String | Text content for the button. |
textStyle | No | TextStyle | Custom styles for the text. |
Prop | Required | Type | Description |
---|---|---|---|
children | No | ReactNode | Child components for the SVG button. |
Prop | Required | Type | Description |
---|---|---|---|
isLoading | No | Boolean | Indicates if the button is in a loading state. |
loaderColor | No | ColorValue | Color of the loading indicator. |
loaderSize | No | Number or 'small' or 'large' or undefined | Size of the loading indicator. Default is small . |
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.
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
Did you know?
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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.