Payload CMS plugin to add a phone number field
Installation
npm i payload-plugin-phone-field12
Stars
0
Forks
0
Open Issues
3 years ago
Last Updated
1
Weekly Downloads
v1.0.6
npm Version
10.2 KB
Unpacked Size
1
Dependencies
Trends appear after 7 days of data. Daily snapshots have not started yet.
Trends appear after 7 days of data. Daily snapshots have not started yet.
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/559376777-root)<a href="https://payloaddirectory.dev/plugins/559376777-root"><img src="https://payloaddirectory.dev/badge/559376777-root.svg" alt="Payload Directory"></a>README
# payload-plugin-phone-field
Uses [react-phone-number-input](https://www.npmjs.com/package/react-phone-number-input) to add phone number fields to [PayloadCMS](https://payloadcms.com/).
## Installation
```
yarn add payload-plugin-phone-field
```
or
```
npm i payload-plugin-phone-field
```
## Usage
Really straightforward implementation:
```js
import { phoneField } from 'payload-plugin-phone-field'# payload-plugin-phone-field
Uses [react-phone-number-input](https://www.npmjs.com/package/react-phone-number-input) to add phone number fields to [PayloadCMS](https://payloadcms.com/).
## Installation
```
yarn add payload-plugin-phone-field
```
or
```
npm i payload-plugin-phone-field
```
## Usage
Really straightforward implementation:
```js
import { phoneField } from 'payload-plugin-phone-field'
fields: [
phoneField(
{
name: 'phone', // required
}
)
]
```
But you can also add any options that TextField accepts and any options that [PhoneNumberInput](https://catamphetamine.gitlab.io/react-phone-number-input/docs/index.html) accepts.
For example, add a label, required and validation plus only show 6 countries to choose from:
```js
fields: [
phoneField(
{
name: 'phone', // required
label: 'Contact Phone Number',
required: true,
validate: phoneIsValid
},
{ countries: ['DK', 'FI', 'NO', 'SE', 'GB', 'US'] }
)
]
```
You can use your own validation function or one of the two included. You can read the rationale from [Nikolay Kuchumov](https://gitlab.com/catamphetamine/libphonenumber-js#using-phone-number-validation-feature).
```js
import { phoneIsValid, phoneIsPossible } from 'payload-plugin-phone-field'
```
Topics
encrypted fields
Encrypt field values at rest in the database with a drop-in encryptedField helper
6955/wk83v3
payload icon picker
Icon picker field with searchable dropdown or drawer grid that stores the icon name and raw SVG
690/wk52v3
payload phone number plugin
Phone number field with country selection, formatting and validation powered by libphonenumber-js
64114/wk16v3
payload plugin json form builder
Edit a Payload JSON field as real admin fields using a builder inside the admin panel
580/wk29v3
payload plugin icons
Icon picker field for Payload with Lucide and Phosphor providers and a React rendering component
570/wk2v3
select search field
Server-backed searchable select field for Payload with custom search functions
560/wk15v3