phone-input-usage

Integrate PhoneInput compound parts with country selection and validation in React.

2|Updated Dec 2, 2024
One-click install
npx skills add https://github.com/TechsioCZ/new-engine --skill phone-input-usage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phone-input-usage
Source: https://github.com/TechsioCZ/new-engine/tree/main/libs/ui/skills/phone-input-usage
Command: npx skills add https://github.com/TechsioCZ/new-engine --skill phone-input-usage

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

International phone inputs with country selection and validation are often complex to implement consistently. This Skill provides a ready-made pattern to integrate a robust PhoneInput with country selection, validation, and structured event data in UI apps.

Core Features & Use Cases

  • Compound parts usage: Use Label, Control, CountryPicker, and Input to build a complete PhoneInput.
  • Automatic country handling: Syncs country selection with explicit input values and supports default country.
  • Detailed change events: Exposes value, e164, country, callingCode, nationalNumber, isPossible, and isValid for downstream forms and validation.

Quick Start

Wrap the PhoneInput with its subparts (Label, Control, CountryPicker, Input) to render a fully functional international phone field.

Frequently Asked Questions about phone-input-usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add an international phone input with country selection in React?

To add an international phone input in React, use the PhoneInput compound parts including Label, Control, CountryPicker, and Input to render a complete field with automatic country handling and structured change events.

How do I validate an international phone number in a React form?

You validate an international phone number in a React form by checking the structured change details exposed by the phone input, which include isPossible and isValid properties for downstream validation.

What data is available when extracting phone number values for form submission?

Extracting phone number values for form submission provides structured data including value, e164, country, callingCode, nationalNumber, isPossible, and isValid for downstream processing and validation.

Can I set a default country and sync it with the phone input value?

Yes, the phone input supports setting a default country and automatically syncs country selection with explicit input values to ensure consistent international phone entry.

Does this phone input component work with @techsio/ui-kit?

Yes, this phone input component is designed for React projects using @techsio/ui-kit and enforces using PhoneInput compound parts including Label, Control, CountryPicker, and Input for proper integration.

What is the best way to structure a phone input with a country picker in a UI kit?

The best way to structure a phone input with a country picker is using compound parts where Label, Control, CountryPicker, and Input work together to handle country selection, validation, and structured event data automatically.