Skip to content

Commit 5ec9c59

Browse files
committed
Add a descriptive "Usage" section
1 parent d6aabfe commit 5ec9c59

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

README.md

+6-24
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,22 @@ This comprehensive toolkit features custom hooks and utility functions tailored
1010
and validation. It supports international standards, making it suitable for phone number processing applications across
1111
different countries and regions.
1212

13-
## Features
13+
## Usage
1414

15-
- Build a phone number input component with a country selector.
16-
- Parse the phone metadata and validate phone numbers.
17-
- Format raw phone numbers into a more readable format and the opposite.
15+
This library can be used to build a phone number input component with a country selector for React applications. As well
16+
as to parse the phone metadata, validate phone numbers, format raw phone numbers into a more readable format and the
17+
opposite. You can use the [development](./development) to test and develop your own components.
1818

1919
### useMask
2020

2121
```jsx
22+
import {useMask} from "react-phone-hooks";
23+
2224
const PhoneInput = (props) => {
2325
return <input {...useMask("+1 (...) ... ....")} {...props}/>
2426
}
2527
```
2628

27-
### usePhone
28-
29-
```javascript
30-
const {
31-
value,
32-
pattern,
33-
metadata,
34-
setValue,
35-
countriesList,
36-
} = usePhone({
37-
query,
38-
country,
39-
countryCode,
40-
initialValue,
41-
onlyCountries,
42-
excludeCountries,
43-
preferredCountries,
44-
})
45-
```
46-
4729
## Contribute
4830

4931
Any contribution is welcome. Don't hesitate to open an issue or discussion if you have questions about your project's

0 commit comments

Comments
 (0)