Skip to content

BbTextarea

Captures multi-line text values.

import { BbTextarea } from 'bitboss-ui';

On this page

Props

NameTypeDefaultDescription
append:iconstring | undefined-

Name of the icon to be added at the end of the input.

autocompletestring | undefined-

Guides to the browser as to the type of information expected in the field.

autofocusBooleanish | undefined-

Sets autofocus on page load.

autoGrowboolean | undefinedfalse

Expands the textarea to match its content.

Drops the native resize handle and grows the field to fit its content, animated through BbSmoothHeight. Combine it with rows instead of a CSS min-height: a min-height fights the growth calculation, rows feeds it.

See example
clearableboolean | undefinedfalse

Displays a clear button when the input has a value and is being interacted with.

Same behaviour as on BbTextInput: no clear event, the model simply goes null.

See example
compactboolean | undefinedfalse

Sets the component in a compact state.

See example
descriptionstring | undefined-

Descriptive text displayed below the label and above the input. Unlike the hint it is always visible, and it is linked to the input via aria-describedby (after any errors / warnings, before the hint).

See example
directionInputDirection | undefined-

Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like xx xxxxx.

Applies only while the resolved label mode is outside; floating and inside force the vertical layout and ignore it silently. A label beside a four-line box is what makes this component good for settings rows.

See example
disabledboolean | undefinedfalse

Disables the component.

errorsstring | string[] | undefined-

Can be a string or an array of string containing the messages to display. They render in an aria-live="polite" region (announced when they appear) and, while the list is non-empty, are referenced FIRST from the control's aria-describedby, so the reason the field is invalid is re-read whenever the control regains focus.

Also the way a character counter reaches assistive tech — a suffix counter is visual only, and the textarea enforces no limit of its own.

See example
hasErrorsboolean | undefinedfalse

Define if the component should be in an error state. It usually attaches a CSS class for styling purposes.

hasWarningsboolean | undefinedfalse

Define if the component should be in a warning state. Same chrome as errors with --bb-warn; errors take priority.

hideLabelboolean | undefinedfalse

Visually hides the label of the input while maintaining accessibility.

hintstring | undefined-

Text box to be displayed near the input, usually to indicate instructions.

See example
idstring | undefined-

The identifier of the component.

labelrequiredstring-

Text content of the label of the element.

Required, and display and accessibility only — it does not set name.

See example
labelMode"outside" | "floating" | "inside" | undefined-

Label rendering mode. 'outside' (default) sits the label above/beside the field; 'floating'/'inside' overlay it, like the other text inputs.

Works exactly as on BbTextInput, including the defaultInputLabelMode fallback. A bare floating attribute is not a prop: write label-mode="floating".

See example
labelPosition"left" | "center" | "right" | undefined-

Sets the text alignment of the label.

loadingboolean | undefinedfalse

Sets the component in a loading state, usually triggering some visual styles.

Visual only — the field stays editable during an autosave round-trip.

See example
modelValuerequiredstring | null-

Used by v-model.

namestring | undefined-

Defines the name of the input.

Unset, the rendered <textarea> carries no name, so a native form post drops the value silently.

See example
persistentHintboolean | undefinedfalse

Keeps the hint displayed.

placeholderstring | undefined-

String displayed when there's no data.

prepend:iconstring | undefined-

Name of the icon to be added at the start of the input.

ptPtMap<TextControlPtPart, FormControlPtState> | undefined-

Passthrough, object form: { box: '…', 'box:errors': '…' } — the same keys as the pt:* attributes without the prefix. See the pt:<part> row.

pt:boxPtValue | undefined-
pt:box:disabledPtValue | undefined-
pt:box:errorsPtValue | undefined-
pt:box:has-valuePtValue | undefined-
pt:box:loadingPtValue | undefined-
pt:box:readonlyPtValue | undefined-
pt:box:warningsPtValue | undefined-
pt:clearPtValue | undefined-
pt:clear:disabledPtValue | undefined-
pt:clear:errorsPtValue | undefined-
pt:clear:has-valuePtValue | undefined-
pt:clear:loadingPtValue | undefined-
pt:clear:readonlyPtValue | undefined-
pt:clear:warningsPtValue | undefined-
pt:descriptionPtValue | undefined-
pt:description:disabledPtValue | undefined-
pt:description:errorsPtValue | undefined-
pt:description:has-valuePtValue | undefined-
pt:description:loadingPtValue | undefined-
pt:description:readonlyPtValue | undefined-
pt:description:warningsPtValue | undefined-
pt:hintPtValue | undefined-
pt:hint:disabledPtValue | undefined-
pt:hint:errorsPtValue | undefined-
pt:hint:has-valuePtValue | undefined-
pt:hint:loadingPtValue | undefined-
pt:hint:readonlyPtValue | undefined-
pt:hint:warningsPtValue | undefined-
pt:iconPtValue | undefined-
pt:icon:disabledPtValue | undefined-
pt:icon:errorsPtValue | undefined-
pt:icon:has-valuePtValue | undefined-
pt:icon:loadingPtValue | undefined-
pt:icon:readonlyPtValue | undefined-
pt:icon:warningsPtValue | undefined-
pt:inputPtValue | undefined-
pt:input:disabledPtValue | undefined-
pt:input:errorsPtValue | undefined-
pt:input:has-valuePtValue | undefined-
pt:input:loadingPtValue | undefined-
pt:input:readonlyPtValue | undefined-
pt:input:warningsPtValue | undefined-
pt:labelPtValue | undefined-
pt:label:disabledPtValue | undefined-
pt:label:errorsPtValue | undefined-
pt:label:has-valuePtValue | undefined-
pt:label:loadingPtValue | undefined-
pt:label:readonlyPtValue | undefined-
pt:label:warningsPtValue | undefined-
pt:messagePtValue | undefined-
pt:message:disabledPtValue | undefined-
pt:message:errorsPtValue | undefined-
pt:message:has-valuePtValue | undefined-
pt:message:loadingPtValue | undefined-
pt:message:readonlyPtValue | undefined-
pt:message:warningsPtValue | undefined-
pt:prefixPtValue | undefined-
pt:prefix:disabledPtValue | undefined-
pt:prefix:errorsPtValue | undefined-
pt:prefix:has-valuePtValue | undefined-
pt:prefix:loadingPtValue | undefined-
pt:prefix:readonlyPtValue | undefined-
pt:prefix:warningsPtValue | undefined-
pt:rootPtValue | undefined-
pt:root:disabledPtValue | undefined-
pt:root:errorsPtValue | undefined-
pt:root:has-valuePtValue | undefined-
pt:root:loadingPtValue | undefined-
pt:root:readonlyPtValue | undefined-
pt:root:warningsPtValue | undefined-
pt:spinnerPtValue | undefined-
pt:spinner:disabledPtValue | undefined-
pt:spinner:errorsPtValue | undefined-
pt:spinner:has-valuePtValue | undefined-
pt:spinner:loadingPtValue | undefined-
pt:spinner:readonlyPtValue | undefined-
pt:spinner:warningsPtValue | undefined-
pt:suffixPtValue | undefined-
pt:suffix:disabledPtValue | undefined-
pt:suffix:errorsPtValue | undefined-
pt:suffix:has-valuePtValue | undefined-
pt:suffix:loadingPtValue | undefined-
pt:suffix:readonlyPtValue | undefined-
pt:suffix:warningsPtValue | undefined-
readonlyboolean | undefinedfalse

Sets the input in a readonly state.

requiredboolean | undefinedfalse

Sets the input as required.

reverseboolean | undefinedfalse

Reverses the layout. Applicable in every direction the order of the label and the input is swapped.

rowsstring | number | undefined-

Sets the number of visible text lines for the control.

On its own, a fixed height with the native resize handle. With auto-grow, the floor the field starts at and never shrinks below.

See example
variantInputVariantType | undefined'outline'

Visual variant of the field box — the same names and tokens as the BbButton variants. Colours only: height, padding and border width are identical across variants, so a form never reflows when one changes. 'ghost' has no border in any state (errors and warnings show through the icon and the messages); every variant keeps the focus ring. Register extra names with the plugin's inputVariants option.

warningsstring | string[] | undefined-

Warning messages to display beneath the field, in their own aria-live region and amber (--bb-text-warn). A string or array; a non-empty list implies the warning state. Errors suppress warnings when both are set. While displayed they are also referenced from the control's aria-describedby, after any errors and before the description/hint.

See example

v-model

Values kept in sync through v-model.

NameTypeDescription
modelValuestring | null

string | null, like every field in the family: emptied means null, never ''.

See example

Events

NameTypeDescription
blur(event: "blur", event: FocusEvent): void
change(event: "change", event: Event): void
click(event: "click", event: MouseEvent): void
compositionend(event: "compositionend", event: CompositionEvent): void
compositionstart(event: "compositionstart", event: CompositionEvent): void
focus(event: "focus", event: FocusEvent): void
input(event: "input", event: Event): void

Also stopPropagation()d, so an ancestor listening across a whole form will not hear this field. Bind here, or watch the model.

See example
keydown(event: "keydown", event: KeyboardEvent): void

Forwarded, but not bubbled: the component calls stopPropagation() on keydown, so no ancestor handler sees the key — not a form-level ⌘+Enter shortcut, not a dialog listening for Escape. Wire the action to a button.

See example
keyup(event: "keyup", event: KeyboardEvent): void
mousedown(event: "mousedown", event: MouseEvent): void
mouseup(event: "mouseup", event: MouseEvent): void
paste(event: "paste", event: ClipboardEvent): void
update:modelValue(event: "update:modelValue", value: string | null): void

Slots

The listed properties are the ones exposed to the slot scope.

NameTypeDescription
appendRecord<string, never>

Content rendered after the textarea, at the end of the inner container.

append-outerRecord<string, never>

Content rendered after the entire textarea control, outside the input chrome.

descriptionBbTextareaDescriptionSlotProps

Replaces the description text. Provided alone (no description prop) it still renders the description region and wires it into aria-describedby.

labelBbTextareaLabelSlotProps

Replaces the default label text rendered above the textarea.

prefixRecord<string, never>

Inline content rendered at the start of the textarea field area, before the text.

prependRecord<string, never>

Content rendered before the textarea, at the start of the inner container.

prepend-outerRecord<string, never>

Content rendered before the entire textarea control, outside the input chrome.

suffixRecord<string, never>

Inline content rendered at the end of the textarea field area, after the text.

The home for a character counter: beside the value rather than below it, where it would compete with the hint.

See example

Changes from v2

Props removed or renamed in 3.0. If you are coming from v2, the answer is here.

  • hasWarninghasWarningsfails silently