Textarea

Multi-line inputs for forms

Contents

Inputs
control : FormControl<string>
disabled : boolean
id : string
asInput ?: boolean = false
autoComplete ?: string = 'off'
autoFocus ?: AutoFocusOption = AutoFocusOption.NONE
autoGrow ?: boolean = false

Set to `true` to automatically adjust the height of the text area when typing

autoGrowMaxHeight ?: number = 72

Maximum height in pixels the text area will grow. `autoGrow` must be true to have an effect. Minimum height is always the default height based on `rows`.

autoHideCounter ?: boolean = true

Hides max character counter when blurred out of field

borderRadius ?: TextareaBorderRadius = 'small'
borderless ?: boolean = false
borderlessFocusLine ?: boolean = true
clearButtonIcon ?: IconName = 'flBinOutline'
clearButtonIconLabel ?: string
clearButtonIconSize ?: IconSize = IconSize.SMALL
clearButtonPosition ?: TextAreaClearContentButtonPosition = 'right'

Position in the footer of the clear button. Input does nothing if `maxCharacter` is enabled, it will always go to the opposite side of `maxCharacter`

clearButtonText ?: string
clearButtonTextSize ?: TextSize = TextSize.BODY_16
counterMatchesErrorSize ?: boolean = false

Sizes the max character counter like the validation error text, so the two read as one status line when they swap

displayCurrentCharCount ?: boolean = false

Displays current/max characters when maxCharacter is provided

dynamicValidation ?: "submit" | "blur"

First validation happens only on blur/submit, and validates on keyup once an error exists

enableClearButton ?: boolean = false
fontColor ?: FontColor.FOREGROUND | FontColor.DARK | FontColor.LIGHT = FontColor.FOREGROUND
hideScrollbar ?: boolean = false
iconStart ?: IconName

Icon rendered inside the textarea

iconStartSize ?: IconSize = IconSize.SMALL
label ?: string

Sets aria label for accessibility when there is no associated visible text

maxCharacter ?: number
maxCharacterPosition ?: TextareaMaxCharPosition = TextareaMaxCharPosition.LEFT
maxLength ?: number
minHeight ?: number

Minimum height in pixels; overrides the `rows`-based height, and with `autoGrow` it is the floor the textarea grows from.

padding ?: TextareaPadding = 'default'

Field padding; 'compact' reduces the vertical padding, 'none' removes it entirely, e.g. to align with surrounding text

paddingEnd ?: number

Extra right padding in pixels.

placeholder ?: string = ''
placeholderColor ?: PlaceholderColor = PlaceholderColor.INHERIT

Sets the color of the placeholder text

placeholderNoWrap ?: boolean = false

Disable placeholder wrapping

preventNewlines ?: boolean = false

Treat the field as a wrapping single line. Enter does not insert a newline, and pasted or dropped line breaks are flattened to spaces.

resize ?: Resize = Resize.VERTICAL
rows ?: number = 2
shakeOnBlur ?: boolean = true

Shakes the textarea when a validation error shows. Set to `false` to show the error border and message without shaking.

showValidationError ?: boolean = true

When false, suppresses in-component validation error messages and shaking animations.

size ?: TextSize = TextSize.BODY_16
sizeDesktop ?: TextSize
sizeDesktopXLarge ?: TextSize
sizeTablet ?: TextSize
warning ?: boolean = false

Shows a warning border. The caller decides when to set this, e.g. when the content is nearing `maxCharacter`; the textarea does not detect that itself. The warning colour replaces the focus ring while focused. A validation error border takes precedence. While this is set: - the error border stays red when focused, instead of switching to the focus colour - going over `maxCharacter` shows the error border straight away, matching the red counter, without waiting for blur/submit - while focused and over `maxCharacter`, the "characters over limit" counter shows in place of the error message, which returns on blur

weight ?: FontWeight = FontWeight.NORMAL
weightDesktop ?: FontWeight
weightTablet ?: FontWeight
Outputs
inputBlur ?: any = new EventEmitter<void>()
inputFocus ?: any = new EventEmitter<void>()
inputHandled ?: any = new EventEmitter<void>()
inputSelect ?: any = new EventEmitter<TextareaSelectEvent>()

Event emitted everytime a user highlights a text in the textarea