Skip to content

Commit 1a987f6

Browse files
committed
readme update
1 parent 9892991 commit 1a987f6

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
## Contact form React Component.
1+
## Contact form React Component with PHP mail api.
22

33
This is code for tutorial in my blog post [Create Contact form with react and php](https://blog.bitsrc.io/how-to-build-a-contact-form-with-react-js-and-php-d5977c17fec0).
44

55
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)
66

7-
## How to start
7+
## Usage of complete project.
88

9-
In the project root directory, Please run:
9+
Please clone this repo and in the project root directory, Please run:
1010

1111
### `npm install`
1212

@@ -21,6 +21,33 @@ The page will reload if you make edits.<br>
2121
You will also see any lint errors in the console.
2222

2323

24+
25+
## Usage only the component
26+
27+
Please download 'src/components/Form/' folder.
28+
29+
You can use the form component like this `<Form config={config} />`
30+
31+
####props
32+
33+
`config - object`
34+
35+
Example of config prop
36+
37+
`config = {
38+
api: `${process.env.REACT_APP_API}`,
39+
title: 'Contact Me',
40+
successMessage: 'Thank you for contcting me.',
41+
errorMessage: 'Sorry we have some problems.',
42+
fields: [
43+
{ id: 1, label: 'First Name', type: 'text',placeholder:'Your First Name', isRequired: true , klassName:'first-name-field'},
44+
{ id: 2, label: 'Last Name', type: 'text', placeholder: 'Your Last Name', isRequired: true , klassName:'last-name-field'},
45+
{ id: 3, label: 'Email', type: 'email', placeholder: ' Your Email', isRequired: true , klassName:'email-field'},
46+
{ id: 4, label: 'Message', type: 'textarea',placeholder:'Write something.....', isRequired: true , klassName:'message-field'}
47+
]
48+
}`
49+
50+
2451
<div align="center">
2552
<a href="https://www.paypal.me/craftcode"><img alt="Header" src="/screenshot.png?raw=true" width="80%"></a>
2653
</div>

0 commit comments

Comments
 (0)