A phone field formatted based on the user's location.

Introduction

This template adds an international phone input field component to your project using react-phone-number-input, enhanced with location detection via the Croct Evaluation API.

The field automatically detects the user's location based on the user's IP and sets the appropriate country code and formatting.

Built with Next.js and fully integrated with Croct, this phone input template is ideal for forms and signup flows that require seamless international phone number handling and geo-personalized experiences.

Usage

To create a new project using this template, run:

npx croct@latest use npm://react-phone-number-input

You can customize the template by specifying options:

npx croct@latest use npm://react-phone-number-input --router=page

Options

The following options are available for this template:

OptionDescriptionRequiredDefault
projectNameThe name of the project.Nomy-app
versionThe Next.js version to use.Nolatest
routerThe router to use (app or page).Noapp
javascriptWhether to use JavaScript instead of TypeScript.Nofalse

Start building in seconds

Paste the following command in your terminal and let the CLI do the rest.

npx croct@latest init