Text Input(iOS)

A control that allows single line text input.


The single line text input control TextInput is build upon the built-in UIKit component UITextField.

Default TextInput

let textInput = TextInput()



The placeholder text that’s shown when no text has been entered. Placeholder text is shown in gray.

Placeholder TextInput

textInput.placeholder = "Type something..."


If true, the control will be red. Use this property if something’s wrong and the text input control needs a user’s attention.

Error TextInput

textInput.hasError = true


If false, the control will not react to user interaction and will have a light gray color.

Disabled TextInput

textInput.isEnabled = false


If true, the control has a blue border.

Highlighted TextInput

textInput.isHighlighted = true

leftView and rightView

These properties are inherited from UITextField and typically make it possible to show image based buttons on both sides of the text. More info can be found in the official UITextField documentation.

Leftview TextInput

let leftView = UIButton(type: .system)
leftView.setTitle("left", for: .normal)
textInput.leftView = leftView
textInput.leftViewMode = .always


This property is inherited from UITextField and determines when the standard clear button appears. More info can be found in the official UITextField documentation.

textInput.clearButtonMode = .whileEditing


Suppresses the cursor display while the control is active.

textInput.hidesCaret = true
Was this page helpful?

We use this feedback to improve the quality of our documentation.