Phone Field Input

Phone Field Input: Phone field with dial-code prefix and live US-style formatting. Returns raw digits via onChange for validation and API calls. Free MIT React & Next.js source with Motion and Tailwind CSS, live preview, CLI install and docs.

Install Phone Field Input

npx motion-ui-skill add phone-field-input

Components install as source into your project. The interactive page also includes preview, code, documentation and install tabs.

Dependencies

  • clsx
  • react
  • tailwind-merge

Source files

Phone Field Input

Phone field with dial-code prefix and live US-style formatting. Returns raw digits via onChange for validation and API calls.

Install

npx motion-ui-skill add phone-field-input

Dependencies

  • clsx
  • react
  • tailwind-merge

Usage

"use client";

import { PhoneFieldInput } from "@/components/inputs/phone-field-input";

export function PhoneFieldInputDemo() {
  return (
    <div className="flex items-center justify-center p-6">
      <PhoneFieldInput />
    </div>
  );
}

API Reference

PhoneFieldInput

Prop Type Default Required Description
className string — No Additional CSS classes

Browse this category