inputs/DSPhoneField
DSPhoneField
inputsPhone 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
| Prop | Type | Default | Description |
|---|---|---|---|
| phonereq | Binding<String> | โ | Bound E.164 formatted phone string. |
| countryCode | Binding<String> | "+1" | Selected country dial code. |
| label | String? | nil | Label above the field. |
| placeholder | String | "(555) 000-0000" | Placeholder text. |
| error | String? | nil | Validation 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
)