🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more
Socket
Book a DemoInstallSign in
Socket

@rn-components-kit/button

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rn-components-kit/button

Button component.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Button

NPM version

English | 中文

Button component. It supports the following features:

  • default, primary, success, warning and danger five themes
  • small, default and large three sizes
  • square, default and round three shapes
  • supports icon buttons and customize icon direction
  • supports outline style button
  • supports block level button
  • supports link style button

How to use

npm install @rn-components-kit/button --save
PreviewCode
Demo1 Code
Demo2 Code
Demo3 Code
Demo4 Code
Demo5 Code
Demo6 Code
Demo7 Code

Props

Methods

Reference

Props

style

Allow you to customize style

TypeRequiredDefault
objectno-

text

Text to display in button

TypeRequiredDefault
stringno-

icon

Icon to display in button

TypeRequiredDefault
Icon Presetno-

iconLeft

Determines icon's direction in button is left or right

TypeRequiredDefault
booleannotrue

type

Button type, determines button's theme

TypeRequiredDefault
enum('default' | 'primary' | 'success' | 'warning' | 'danger' | 'link')no'default'

size

Button size

TypeRequiredDefault
enum('small' | 'default' | 'large')no'default'

shape

Button Shape

TypeRequiredDefault
enum('default' | 'round' | 'square')no'default'

block

Block level button

TypeRequiredDefault
booleannofalse

outline

Applies outline button style

TypeRequiredDefault
booleannofalse

Applies link button style

TypeRequiredDefault
booleannofalse

Methods

updatePreset

updatePreset(preset);

This method offers an opportunity to change button presetted style. The preset is:

{
  "theme": {
    "default": "#EFEFEF",
    "primary": "#40A9FF",
    "warning": "#E6A23C",
    "danger": "#D9534F",
    "success": "#67C23A"
  },
  "small": {
    "fontSize": 12,
    "borderRadius": 4,
    "paddingHorizontal": 10,
    "paddingVertical": 5,
    "iconTextSpacing": 5
  },
  "default": {
    "fontSize": 14,
    "borderRadius": 4,
    "paddingHorizontal": 12,
    "paddingVertical": 6,
    "iconTextSpacing": 7
  },
  "large": {
    "fontSize": 18,
    "borderRadius": 4,
    "paddingHorizontal": 16,
    "paddingVertical": 10,
    "iconTextSpacing": 9
  }
}

Keywords

react-native

FAQs

Package last updated on 26 Jun 2019

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