Skip to content

Latest commit

 

History

History
222 lines (214 loc) · 7.2 KB

Button.md

File metadata and controls

222 lines (214 loc) · 7.2 KB

button-def-headref

Button

Button is a pure NativeBase component.
Buttons are the integral part of an application. They are used for various purposes like, submit or reset a form, navigate, performing interactive actions such as showing or hiding something in an app on click of the button, etc.

Preview ios button-def-headref Preview android button-def-headref

Contents:

Syntax {% codetabs name="Basic", type="js" -%} import React, { Component } from 'react'; import { Container, Content, Button } from 'native-base'; export default class ButtonExample extends Component { render() { return ( // NativeBase default style Click Me! ); } } {%- language name="Advanced", type="js" -%} import React, { Component } from 'react'; import { Container, Content, Button, Text } from 'native-base'; export default class ButtonExample extends Component { render() { return ( // NativeBase default style Click Me! ); } } {%- endcodetabs %}

  • NativeBase provides Button component which is readily not available in React Native.
  • Supports React Native app on both iOS and Android devices.
  • Button component takes input such as: Text, Icon, Text with Icon.
  • NativeBase gives you privilege to customize the props of this component.
    Example: To have custom style for button, include them in style prop of button.
  • Intakes user-defined styles.
  • NativeBase has provided its users with enormous list of props that can be used with Button.
  • Replacing Component: React Native <TouchableOpacity>

**Configuration**
Property Default Option Description
style - - Defines button style
active - true Boolean value to describe state of Button
block - - Block level button
bordered - - Applies outline button style.
disabled true true false Disables click option for button
large - - For large size button
rounded - - Renders button with slightly round shaped edges.
small - - For small size button
full - - full width button
iconRight - - Right Padding for the icon
iconLeft - - Left Padding for the icon.
primary - true,false Add a blue background color to your component
success - true,false Add a green background color to your component
light - true,false Add a light white background color to your component.
info - true,false Add a light blue background color to your component as shown
warning - true,false Add a yellow warning background color to your component
danger - true,false Add a red background color to your component
dark - true,false Add a black background color to your component