TidalUI

Phone input preview

Collect an exact phone value with explicit country context, optional extension and consumer-owned paste parsing.

pro · Forms · composite

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/phone-input

Import components/ui/tidal.css, components/ui/phone-input.css. Wrap installed components in tidal-scope.

Preview

Phone input component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/phone-input.css";
import{TidalPhoneInput}from"./components/ui/phone-input";
export default()=><div className="tidal-scope"><TidalPhoneInput countries={[{code:"value",label:"Demo",dialCode:"value"}]} label={"Demo"} value={{country:"value",number:"value"}}/></div>;

API and props

TidalPhoneInput.countries (required)
ReadonlyArray<TidalPhoneCountry>

Required countries value accepted by this exported component.

TidalPhoneInput.label (required)
ReactNode

Required label value accepted by this exported component.

TidalPhoneInput.value (required)
TidalPhoneValue

Required value value accepted by this exported component.

TidalPhoneInput.countryLabel
ReactNode

Optional country label value accepted by this exported component.

TidalPhoneInput.countryName
string | undefined

Optional country name value accepted by this exported component.

TidalPhoneInput.countrySelectProps
NativeCountryProps | undefined

Optional country select props value accepted by this exported component.

TidalPhoneInput.countrySelectRef
Ref<HTMLSelectElement> | undefined

Optional country select ref value accepted by this exported component.

TidalPhoneInput.description
ReactNode

Optional description value accepted by this exported component.

TidalPhoneInput.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalPhoneInput.error
ReactNode

Optional error value accepted by this exported component.

TidalPhoneInput.extensionInputProps
NativeInputProps | undefined

Optional extension input props value accepted by this exported component.

TidalPhoneInput.extensionInputRef
Ref<HTMLInputElement> | undefined

Optional extension input ref value accepted by this exported component.

TidalPhoneInput.extensionLabel
ReactNode

Optional extension label value accepted by this exported component.

TidalPhoneInput.extensionName
string | undefined

Optional extension name value accepted by this exported component.

TidalPhoneInput.form
string | undefined

Optional form value accepted by this exported component.

TidalPhoneInput.labels
Partial<{ dialCode: string; configurationError: ReactNode; unavailableCountry: string; }> | undefined

Optional labels value accepted by this exported component.

TidalPhoneInput.numberInputProps
NativeInputProps | undefined

Optional number input props value accepted by this exported component.

TidalPhoneInput.numberLabel
ReactNode

Optional number label value accepted by this exported component.

TidalPhoneInput.numberName
string | undefined

Optional number name value accepted by this exported component.

TidalPhoneInput.onValueChange
((next: TidalPhoneValue, field: "country" | "number" | "extension", event: TidalPhoneChangeEvent) => void) | undefined

Callback invoked when the value change interaction is proposed.

TidalPhoneInput.parsePaste
((request: TidalPhonePasteRequest) => TidalPhoneValue | null) | undefined

Optional consumer parser used only for paste. Returning null rejects the paste.

TidalPhoneInput.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalPhoneInput.required
boolean | undefined

Optional required value accepted by this exported component.

TidalPhoneInput.rootClassName
string | undefined

Optional root class name value accepted by this exported component.

TidalPhoneInput.rootProps
Omit<HTMLAttributes<HTMLDivElement>, "className" | "aria-disabled" | "children" | "dangerouslySetInnerHTML"> | undefined

Optional root props value accepted by this exported component.

TidalPhoneInput.rootRef
Ref<HTMLDivElement> | undefined

Optional root ref value accepted by this exported component.

TidalPhoneInput.showExtension
boolean | undefined

Optional show extension value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas