Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support icon type #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# react-native-form-builder
![alt text](http://g.recordit.co/7PqX8Ft7VO.gif)
![alt text](http://g.recordit.co/RWFvqi5tXG.gif)
# Note:
# Note:
If you're looking for a better form management library with more advanced features, Please check out [React Reactive Form](https://github.com/bietkul/react-reactive-form).
## Features
- Generate Form Fields UI
Expand Down Expand Up @@ -45,8 +45,8 @@ To Install the peer dependecy
```
$ npm i native-base --save

```
link the peer dependecy using
```
link the peer dependecy using

```
react-native link
Expand Down Expand Up @@ -225,6 +225,7 @@ number
| Props | Default | Type | Description |
| :------------ |:--------------- |:---------------| :-----|
| iconName | N/A | `string` | Sets the icon, you can use any icon name which is available in `react-native-vector-icons`|
| iconType | N/A | `string` | Sets icon type to one of the supported icon families `AntDesign`, `MaterialIcons`, etc|
| iconOrientaion | `left (default)` or `right` | `string` | Adjust icon orientation |
| props | N/A | `object` | Here you can define extra props which are applicable for react native TextInput Component. For e.g. { multiline: true, secureTextEntry : true .... }

Expand Down Expand Up @@ -367,7 +368,7 @@ formData = {
status: 'Sad'
}
```

## Add Custom Validations

It's very easy to add your custom validations & error messages with FormBuilder.All you need to do is define a function & pass it as `customValidation` prop.
Expand Down Expand Up @@ -411,7 +412,7 @@ import theme from '../form-theme';
....
/>
```
## Add Custom Components
## Add Custom Components
Build your custom type's components & handle them easily with the help of form builder.
Use the `customComponents` prop of form builder.
### Prototype
Expand Down Expand Up @@ -439,4 +440,3 @@ It's an object of key value pair where key will be the `type` of the component &

## Example
The form in second gif is generated by these <a href="https://github.com/bietkul/react-native-form-builder/blob/master/src/utils/config.js">fields</a>

2 changes: 1 addition & 1 deletion src/fields/textInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class TextInputField extends Component {
<View>
<Item error={theme.changeTextInputColorOnError ? attributes.error : null}>
{ attributes.icon &&
<Icon style={{color:theme.textInputIconColor}} name={attributes.icon} />
<Icon style={{color:theme.textInputIconColor}} name={attributes.icon} type={attributes.iconType} />
}
<Input
style={{
Expand Down