Skip to content

Commit 3507ec7

Browse files
committed
List the features and add some initial examples
1 parent 2dae8e0 commit 3507ec7

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,40 @@ 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
14+
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.
18+
19+
### useMask
20+
21+
```jsx
22+
const PhoneInput = (props) => {
23+
return <input {...useMask("+1 (...) ... ....")} {...props}/>
24+
}
25+
```
26+
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+
1347
## Contribute
1448

1549
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)