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.

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