Textarea

Area where user can enter larger amounts of text. Commonly used in forms.

Default

textarea-default


@State var defaultText = ""
@State var placeholderText = ""
@State var customText = "Default value text"

VStack(alignment: .leading, spacing: Spacing.small) {
  PBTextArea(
    "Label",
    text: $defaultText
  )

  PBTextArea(
    "Label",
    text: $placeholderText,
    placeholder: "Placeholder with text"
  )

  PBTextArea(
    "Label",
    text: $customText
  )
}

Textarea w/ Error

textarea-error


PBTextArea(
  "Label",
  text: $errorText,
  error: "This field has an error!"
)

Props

Name Type Description Default Values
characterCount CharacterCount Adds a character counter to the Textarea .noCount .noCount .count .maxCharacterCount .maxCharacterCountBlock .maxCharacterCountError
inline Bool Changes the style of the Textarea false true false
label String Adds a label nil
placeholder String Adds placeholder text nil
text String Sets the Textarea's text value Binding<String>
error String Changes the style of the Textarea nil