inputs/DSPhoneField

DSPhoneField

inputs
since v2.0

Phone number input with a country code picker, flag icon, and automatic formatting.

iOS 17+

Purpose

Phone number collection in registration, profile, and checkout forms.

Interactive Reference

Live showroom

Need the full visual surface?

Screenshots do not scale well across every component, state, and variant. For the real interactive reference, import the package and launch DSShowcaseRoot().

Best for exploring:

variants, states, categories, and real app examples in one place.

Props

PropTypeDefaultDescription
phonereqBinding<String>โ€”Bound E.164 formatted phone string.
countryCodeBinding<String>"+1"Selected country dial code.
labelString?nilLabel above the field.
placeholderString"(555) 000-0000"Placeholder text.
errorString?nilValidation error message.

Examples

Registration phone step

Phone input in a sign-up flow.

swift
DSPhoneField(
    phone: $phoneNumber,
    countryCode: $countryCode,
    label: "Phone number",
    error: viewModel.phoneError
)

Related Components