Functional, simple and customizable UI buttons for react native. Also contains loading functionality and automatically changes color for dual tone buttons. TypeScript support.

Overview

React Native UI Buttons

npm npm License MIT PRs Welcome

Installation

If you want to use icons make sure you have react-native-vector-icons installed in your project.

npm install --save react-native-ui-buttons

OR

yarn add react-native-ui-buttons

⚙️ Getting started

🚀 Solid Button

import {ButtonSolid} from 'react-native-ui-buttons';

<ButtonSolid
    title={'Button Solid'}
/>

🚀 Dual Tone Outline Button

import {ButtonOutline} from 'react-native-ui-buttons';

<ButtonOutline
    title={'Button Outline'}
/>

NOTE: See TestApp for more examples.

💡 Props

  1. All TouchableOpacityProps are valid.
  2. All props are optional.

🎨 Props to customize container styles

Attributes Type Description Default
title string Name of the button -
useColor string rgb() format required rgb(235, 52, 122)
style ViewStyle style will be applied to button container -

🎨 Props to customize container styles (utils)

Attributes Type Description Default
opacityReducer number ButtonSolid: amount by which opacity of disabled button should be reduced, ButtonOutline: ammount by which background of button should be reduced ButtonSolid 5, ButtonOutline 3
padding number padding of button ButtonOutline 18, ButtonSolid 19
borderRadius number Border Radius of button 4
noDisabledStyle boolean if true disabled button will be styled same as enabled button false

💬 Props to customize text styles

Attributes Type Description Default
textStyle TextStyle style will be applied to text -
textOpacityReducer number (ButtonOutline only) amount by which opacity of text should be reduced, when button is disabled 5
textColor string (ButtonSolid only) color of text rgb(255,255,255)

🔧 Props to manage state of button

Attributes Type Description Default
disabled boolean set it to true when button is disabled false
buttonLoading boolean set it to true when button is loading false

🎞 Props for Icon

Attributes Type Description Default
materialIconRight string name field for MaterialIcon component -
materialIconLeft string name field for MaterialIcon component -
iconColor string Color of icon ButtonOutline useColor, ButtonSolid rgb(255,255,255)
iconSize number Size of icon 18

📦 (Optional) react-native-vector-icons Installation

  1. Install package
npm install --save react-native-vector-icons

IOS

  1. In your Info.plist add
<key>UIAppFonts</key>
<array>
    <string>MaterialIcons.ttf</string>
</array>
  1. Install pods and reinstall app
npx pod-install
npx react-native run-ios

Android

  1. In your android/app/build.gradle add
project.ext.vectoricons = [
    iconFontNames: [ 'MaterialIcons.ttf' ]
]

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
  1. Reinstall app
npx react-native run-ios

📝 Authors

You might also like...

Simple and elegant component-based UI library

Simple and elegant component-based UI library

Simple and elegant component-based UI library Custom components • Concise syntax • Simple API • Tiny Size Riot brings custom components to all modern

Jan 4, 2023

Simple, lightweight, persistent two-way databinding

way.js Simple, lightweight, persistent, framework-agnostic two-way databinding Javascript library. With no to little JS code to write. And no dependen

Dec 30, 2022

An HTML5/CSS3 framework used at SAPO for fast and efficient website design and prototyping

Welcome to Ink Ink is an interface kit for quick development of web interfaces, simple to use and expand on. It uses a combination of HTML, CSS and Ja

Dec 15, 2022

Give your JS App some Backbone with Models, Views, Collections, and Events

____ __ __ /\ _`\ /\ \ /\ \ __ \ \ \ \ \ __ ___\ \ \/'\\ \ \_

Dec 27, 2022

Lightweight and powerful data binding.

Rivets.js Rivets.js is a lightweight data binding and templating system that facilitates building data-driven views. It is agnostic about every aspect

Dec 28, 2022

MVC framework making it easy to write realtime, collaborative applications that run in both Node.js and browsers

Derby The Derby MVC framework makes it easy to write realtime, collaborative applications that run in both Node.js and browsers. Derby includes a powe

Dec 31, 2022

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

Bootstrap Sleek, intuitive, and powerful front-end framework for faster and easier web development. Explore Bootstrap docs » Report bug · Request feat

Jan 4, 2023

Spaced-repetition: for coders and scientists.

Memcode Flashcards: for coders, mathematicians, and physicists. Open-source, free for all. Made with love 💘 Links Site ❤️ : www.memcode.com Patreon:

Dec 30, 2022

A JavaScript implementation of SOM, a minimal Smalltalk for teaching and research.

ohm-som A JavaScript implementation of SOM, a minimal Smalltalk for teaching and research. Just a hobby, won't be big and professional like TruffleSOM

Jun 25, 2021
Releases(v2.1.1)
NativeScript empowers you to access native api's from JavaScript directly. Angular, Vue, Svelte, React and you name it compatible.

NativeScript empowers you to access native APIs from JavaScript directly. The framework currently provides iOS and Android runtimes for rich mobile de

NativeScript 22k Jan 4, 2023
A framework for building native apps with React.

React Native Learn once, write anywhere: Build mobile apps with React. Getting Started · Learn the Basics · Showcase · Contribute · Community · Suppor

Facebook 106.8k Jan 3, 2023
Simple TypeScript fastify template.

Simple fastify template. Instructions: 1.) Clone the repo 2.) Type npm i to install all dependencies 3.) Type npm run dev to make it autorecompile on

Nick 2 Mar 17, 2022
A framework for real-time applications and REST APIs with JavaScript and TypeScript

A framework for real-time applications and REST APIs with JavaScript and TypeScript Feathers is a lightweight web-framework for creating real-time app

Feathers 14.2k Dec 28, 2022
Nest framework TypeScript starter repository

A progressive Node.js framework for building efficient and scalable server-side applications. Description Nest framework TypeScript starter repository

null 2 Sep 24, 2022
🌟 DataFormsJS 🌟 A minimal JavaScript Framework and standalone React and Web Components for rapid development of high quality websites and single page applications.

?? Welcome to DataFormsJS! Thanks for visiting! ?? ?? ?? ?? ?? ?? 中文 (简体) 欢迎来到 DataFormsJS Español Bienvenido a DataFormsJS Português (do Brasil) Bem

DataFormsJS 156 Dec 8, 2022
Brail is a framework built on NextJS for developing email templates in React, and returning HTML that is compatible with major email clients.

Brail is a framework built on NextJS for developing email templates in React, and returning HTML that is compatible with major email clients. It aims to seperate the concerns of generating the emails and delivering them.

null 121 Jan 2, 2023
⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.

Fast 3kB alternative to React with the same modern API. All the power of Virtual DOM components, without the overhead: Familiar React API & patterns:

Preact 33.5k Dec 31, 2022
:fire: An extremely fast, React-like JavaScript library for building modern user interfaces

Inferno is an insanely fast, React-like library for building high-performance user interfaces on both the client and server. Description The main obje

Inferno 15.6k Jan 3, 2023