Skip to content

Select - Frameworks

A select is a form input component that lets users choose one option from a predefined list.

AndroidreleasedElementsreleasediOSreleasedReactreleasedVuereleased

iOS

Syntax

swift
Warp.Select(
    selectedOption: Binding<Warp.Select.SelectorOption?>,
    options: [Warp.Select.SelectorOption],
    placeholder: String = "",
    title: String = "",
    additionalInformation: String? = nil,
    tooltipInfoAction: (() -> Void)? = nil,
    style: Warp.TextFieldStyle = .default,
    helpText: String? = nil
)

Usage

swift
Warp.Select(
    selectedOption: $selectedOption,
    options: options,
    placeholder: "Select an option",
    title: "Select Option",
    additionalInformation: "Additional info",
    tooltipInfoAction: { /* Show popover with additional detail */ },
    style: .default,
    helpText: "This field is required."
)

Warning: The options array should not be empty to ensure proper functionality.

Legacy support

By default Warp components return a SwiftUI View but a UIKit UIView is available as well:

swift
Warp.Select(
    selectedOption: $selectedOption,
    options: options
).uiView

Params

Required props

NameTypeDefaultDescription
selectedOptionBindingBinding to the currently selected option.
options[Warp.Select.SelectorOption]Array of options to display in the select dropdown. Should not be empty.

Optional Props

NameTypeDefaultDescription
placeholderString""Placeholder text shown when no option is selected.
titleString""Label text displayed above the select field.
additionalInformationString?nilOptional additional information displayed next to the label.
styleWarp.TextFieldStyle.defaultVisual style of the select field (default, disabled, readOnly, error).
helpTextString?nilOptional help text displayed below the select field.

Questions?

Feel free to ask any questions on usage in the Warp DS Slack channel: #warp-design-system