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.
Contents:
- Button Theme
- Transparent Button
- Outline Button
- Rounded Button
- Block Button
- Full Button
- Icon Button
- Button Size
- Disabled Button
Syntax {% codetabs name="Basic", type="js" -%} import React, { Component } from 'react'; import { Container, Header, Content, Button, Text } 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, Header, Content, Button, Text } from 'native-base'; export default class ButtonExample extends Component { render() { return ( // NativeBase default style Click Me! ); } } {%- endcodetabs %}- 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 instyleprop of button. - Intakes user-defined styles.
- NativeBase has provided its users with enormous list of
propsthat can be used with Button. - Replacing Component:
- React Native TouchableOpacity for iOS
- React Native TouchableNativeFeedback for Android
**Configuration**
| Property | Default | Option | Description |
|---|---|---|---|
| style | - | - | Defines button style |
| active | - | boolean | Boolean value to describe state of Button |
| transparent | true | boolean | Renders child element of button |
| bordered | - | - | Applies outline button style. |
| rounded | - | - | Renders button with slightly round shaped edges |
| block | - | - | Block level button |
| full | - | - | Full width button |
| disabled | true | boolean | Disables click option for button |
| small | - | - | For small size button |
| large | - | - | For large size button |
| iconRight | - | - | Right Padding for the icon |
| iconLeft | - | - | Left Padding for the icon. |
| light | - | boolean | Add a light white background color to your component. |
| primary | - | boolean | Add a blue background color to your component |
| success | - | boolean | Add a green background color to your component |
| info | - | boolean | Add a light blue background color to your component as shown |
| warning | - | boolean | Add a yellow warning background color to your component |
| danger | - | boolean | Add a red background color to your component |
| dark | - | boolean | Add a black background color to your component |

