Products · Components

TextArea

A field that holds a few lines of text the person types.

For one line, use an Input.

Children: Nothing

Example

The TextArea component
view.dml
<TextArea label="Note" placeholder="What is this payment for?" rows="3" value="{{ note }}" onChange="setNote" />
controller.ts
export default definePage({
  initialState: { note: '' },
  mutations: {
    setNote: (_state, event: ValueEvent) => ({ note: event.detail.value }),
  },
});

Props

PropTypeWhat it is
valuestring
placeholderstring
labelstring
hintstringHelp shown under the field, which error replaces.
errorstringShown under the field in red, in place of hint.
rowsnumberThe lines of text it shows before scrolling. Default: 3.
maxLengthnumber
disabledbooleanDims it, and the person can't use it.

Events

EventSendsNotes
onChange{ value } in detail

Keep reading

On this page