react-country-state-city
Version:
A lightweight and easy-to-use React library that provides a comprehensive list of regions or continents, countries, states, cities languages, and country phone codes for creating dynamic and searchable dropdowns. Ideal for building forms and input fields
14 lines (13 loc) • 653 B
TypeScript
import React, { ChangeEvent, InputHTMLAttributes } from "react";
import { Country } from "../types";
type ComponentProps = Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange"> & {
placeHolder?: string;
options: Array<Country>;
inputClassName?: string;
onTextChange?: (e: ChangeEvent<HTMLInputElement>) => void;
defaultValue?: Country | string;
onChange: (e: Country) => void;
showFlag?: boolean;
};
declare const PhonecodeDropdown: ({ placeHolder, options, onChange, inputClassName, onTextChange, defaultValue, showFlag, ...props }: ComponentProps) => React.JSX.Element;
export default PhonecodeDropdown;