Skip to content

textarea

Multi-line text input bound to a string attribute.

Builder F.textarea(attribute: string): Textarea
Wire type key textarea
Class chain TextareaTextualFieldField
Detail projection text-entry
Column counterpart text cell, i.e. C.text(attribute)

Example

import { F } from '@adonia/core'

F.textarea('excerpt').label('Excerpt').rows(6).autosize().maxLength(500)

Props

Beyond the shared field DSL:

Prop Declared on Behaviour
rows(count: number): this Textarea Initial visible row count (§7.3 rows); the client’s default applies when unset.
autosize(): this Textarea Grows the control with its content (§7.3 autosize). With rows() the row count becomes the MINIMUM height rather than a fixed one.
mask(pattern: string): this TextualField Input mask as a REGEX SOURCE string ('^[A-Z]{2}-\\d{4}$'), not a RegExp: props ride the wire verbatim and must survive JSON.stringify (protocol §2 rule 1). The client uses it to constrain typing; §11.1 compiles the same source into regex(mask) so a client bypass cannot smuggle an unmasked value past the validator.

Validation

Vine base: vine.string().

§11.1 mapping: vine.string().trim() plus the declared length and mask modifiers, read off this.props so a withProps override behaves identically to the typed DSL.

Contributed by TextualField.vineSchema() in packages/core/src/schema/fields/textual.ts. The shared modifiers (required, nullable, requiredWhen, unique, optionality) are applied on top by Field.buildValidation, and a rules() override replaces the base entirely — the validator compiler never branches on the field class.

Declared in

  • packages/core/src/schema/fields/textarea.tsTextarea
  • packages/core/src/schema/fields/textual.tsTextualField
Navigation

Type to search…

↑↓ navigate↵ selectEsc close