Textarea

textarea

The textarea component is used for multi-line text input.

Usage

textarea

import SwiftUI

struct ExampleView: View {

    @State var textareaText:String = ""
    @State var textareaHelperText:String = ""
    @State var textareaState:XelaTextareaState = .Default

    var body: some View {
        XelaTextarea(
            value: $textareaText,
            helperText: $textareaHelperText,
            placeholder: "Placeholder",
            state: $textareaState,
            counter: false
        )
        .padding()
    }
}

Properties

Name Type Default Value Required Description
value Binding < String > - YES Binding textarea value
helperText Binding < String > - YES Binding textarea helper text
placeholder String - YES Textarea placeholder text
state Binding < XelaTextareaState > - YES Binding textarea state (.Default, .Hover, .Error, .Success, .Focus, .Disabled)
disableAutocorrection Bool false NO Disable textarea autocorrection
counter Bool false NO Show textarea symbols counter
maxSymbols Int 200 NO Textare max symbols for counter
placeholderColor Color Color(xelaColor: .Gray8) NO Textarea placeholder color
counterColor Color Color(xelaColor: .Gray8) NO Textarea counter color
disabledTextColor Color Color(xelaColor: .Gray8) NO Textarea disabled text color
errorTextColor Color Color(xelaColor: .Red3) NO Textarea error text color
defaultTextColor Color Color(xelaColor: .Gray2) NO Textarea default text color
disabledBackground Color Color(xelaColor: .Gray12) NO Textarea disabled background color
defaultBackground Color Color(.white) NO Textarea default background color
disabledBorderColor Color Color(xelaColor: .Gray8) NO Textarea disabled border color
errorBorderColor Color Color(xelaColor: .Red3) NO Textarea error border color
successBorderColor Color Color(xelaColor: .Green1) NO Textarea success border color
hoverBorderColor Color Color(xelaColor: .Blue5) NO Textarea hover border color
focusBorderColor Color Color(xelaColor: .Blue5) NO Textarea focus border color
defaultBorderColor Color Color(xelaColor: .Gray11) NO Textarea default border color
disabledHelperText Color Color(xelaColor: .Gray8) NO Textarea disabled helper text color
errorHelperText Color Color(xelaColor: .Red3) NO Textarea error helper text color
successHelperText Color Color(xelaColor: .Green1) NO Textarea success helper text color
defaultHelperText Color Color(xelaColor: .Gray8) NO Textarea default helper text color