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.
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
| 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
)