Unify Logo Footer.svg
Unify Applications
Logo
Text Input & Text Area

Text Input & Text Area

Logo

10 mins READ

Text Input & Text Area

Note: Standalone vs. Form field: These are standalone blocks. When collecting text as part of a form with validation and a submit flow, use the corresponding Form field types (Text, Text Area, Password) inside a Form block instead.

Text Input Block

The Text Input block is a standalone single-line text field. It supports a label and caption, start and end icons, voice dictation, a loading spinner, and detailed typography control. Its value is exposed to the page for binding, and it fires events as the user types, submits, focuses, or leaves the field.

When to Use Text Input

  • Collect one line of text on its own — a search box, a name, a quick filter — anywhere on a page, without a surrounding form.

  • For multi-line text, use the Text Area block.

  • Inside a Form block, use the Text field instead.

Content Properties

PropertyTypeDefaultDescription
defaultValuestring (bindable)Starting value. When bound to a dynamic value, the field updates whenever that value changes — silently overwriting user input with no On Change event.
placeholderstring (translatable)Hint text shown inside the empty field.
addOnslabel / caption / icons / dictationNone enabledLabel (above), Caption (secondary text), Start Icon, End Icon (each with visibility condition), and Dictation (microphone for voice input). On desktop, caption renders above the field; on mobile it renders below.
interactionsevent listEvent handlers for On Change, On Submit, On Focus, On Blur.
permissionspermission ruleRestricts who can see or use the field.

Appearance Properties

PropertyTypeDefaultDescription
sizesm | mdmdOverall control size.
variantghost | outlined | solidoutlinedVisual style of the field border.
autoFocuson/off/conditionsOffFocus the field when it appears. Can be condition-driven.
autoSelecton/off/conditionsOffSelect the existing text on focus.
loadingconditionShows a spinner at the end of the field while true. Hides End Icon and dictation microphone while active.
disabledconditionDisables the field when the condition is true.
valuetypographytext-sm, regularColor, size and weight of the typed text. Does not affect placeholder.
inputBoxpaddingPadding inside the field.
placeholdertypography + alignmentregular, StartColor, weight and alignment of the placeholder text.
visibilityconditionShows or hides the whole block.
stylesstyle setWidth/min/max, flex layout, margin, padding, radius, color, rotation.

Events

EventTriggerPayload
On ChangeValue changes on every keystroke, and when dictation inserts text.value
On SubmitUser presses Enter.
On FocusField gains focus.
On BlurField loses focus.

Methods

MethodParametersWhat It Does
resetTextInputresetToDefaultClears the field, or returns it to its default when resetToDefault is on. Does not fire On Change.
setValuevalueSets the field's value programmatically. Converts anything to a string. Does not fire On Change.
focusTextInputMoves focus into the field. No-op if already focused.

Exposed State

State KeyTypeDescription
{{ id.value }}stringThe current text in the field.
{{ id.isFocused }}booleanWhether the field currently has focus.

Gotchas

Warning: setValue and resetTextInput do not fire On Change. Programmatic value changes are silent — handlers watching the field won't run.

Note: Caption position changes on mobile. Caption renders above the field on desktop but below it on mobile and tablet.

Warning: A changing bound default overwrites user input without notification. If Default value is a binding that changes, the user's typed content is silently replaced.

Text Area Block

The Text Area block is a standalone multi-line text input. It grows with its content between a minimum and maximum number of rows, can show a live remaining-characters counter, and carries optional label, description and help text. Its value is exposed to the page for binding, and it fires events as the user types, submits, focuses, or leaves the field.

When to Use Text Area

  • Collect free-form, multi-line text on its own — comments, notes, descriptions — anywhere on a page, without a surrounding form.

  • For single-line text, use the Text Input block.

  • Inside a Form block, use the Text area field instead.

Content Properties

PropertyTypeDefaultDescription
defaultValuestring (bindable)Starting value. Bound values update the field whenever they change — silently overwriting user input.
placeholderstring (translatable)Hint text shown while empty.
maxCharactersintegerCharacter limit shown as a live countdown in the field's corner. This is a soft display limit — it does not block typing. The counter turns red when exceeded.
slots (Footer)slotEmptyA footer slot inside the field for action buttons or hints. When a footer and Max Characters are both set, the counter moves into the footer row.
addOnslabel / description / helpNoneLabel (above), Description (below label), Help Text (below field), each with typography settings.

Appearance Properties

PropertyTypeDefaultDescription
widthpx or %100%Width of the whole block.
minRowsinteger2The field never shrinks below this many rows.
maxRowsinteger5The field stops growing past this many rows and scrolls.
autofocusbooleanFocus the field when it appears.
autoselectbooleanFocus the field and select its existing text when it appears.
disabledconditionDisables the field when condition is true.
visibilityconditionShows or hides the whole block.
stylesstyle setColor, border radius, border stroke.

Events

EventTriggerPayload
On ChangeValue changes on every keystroke.value
On SubmitUser presses Enter (without Shift). Shift+Enter inserts a line break instead.
On FocusField gains focus.
On BlurField loses focus.

Methods

MethodParametersWhat It Does
resetTextArearesetToDefaultClears the field, or restores default when resetToDefault is on. Does not fire On Change.
setValuevalueSets the field's value programmatically. Converts to string. Does not fire On Change.
focusTextAreaMoves focus into the field.

Exposed State

State KeyTypeDescription
{{ id.value }}stringThe current text.
{{ id.isFocused }}booleanWhether the field currently has focus.

Warning: Maximum Characters is a countdown, not a hard limit. The counter turns red when exceeded but typing continues. Enforce the limit yourself — for example, disable a submit button when {{ textarea1.value.length }} exceeds the cap.

Warning: Enter submits; Shift+Enter makes a new line. Users who expect Enter to insert a line break must hold Shift. If your On Submit handler navigates or clears the field, plain Enter can feel destructive in long-form typing.

Password Block

The Password block is a standalone masked text input with a built-in show/hide toggle. It ships with label, optional description and help text, browser autocomplete control (current password, new password, or off), and standard field events and methods. A new Password block arrives labelled "Password" with placeholder "Enter password" and autocomplete off.

When to Use

  • Collect a password or secret outside a Form — a login screen, API-key prompt, or confirmation gate.

  • Control browser and password-manager behavior with autocomplete settings.

  • Inside a Form, use the Form's Password field instead.

Content Properties

PropertyTypeDefaultDescription
defaultValuestring (bindable)Starting value. A changing binding silently overwrites the user's entry — no On Change fires.
placeholderstring"Enter password"Hint text while empty.
autocompletecurrent-password | new-password | offoffCurrent password suggests saved credentials; New password enables browser password generation on sign-up/reset; Off disables autofill.
addOnslabel + description + helpLabel: "Password"Label, description, and help text around the input.

Appearance Properties

PropertyTypeDefaultDescription
sizesm | mdmdInput height and spacing.
variantoutlined | ghost | solidoutlinedVisual style of the input border.
autoFocuson/off/conditionsoffFocus the input when it appears.
autoSelecton/off/conditionsoffSelect the whole value on focus.
disabledconditionDisables when condition is true.
visibilityconditionShows or hides the block.
stylesstyle setmax-width 30% desktopWidth, margin, padding, border, background.

Events

EventTriggerPayload
On ChangeEvery keystroke that changes the value.value (plain unmasked text)
On SubmitUser presses Enter.
On FocusInput gains focus.— (value not included for security)
On BlurInput loses focus.— (value not included)

Methods

MethodParametersWhat It Does
resetPasswordresetToDefaultClears the value; with resetToDefault on, restores the default. Does not fire On Change.
setValuevalueReplaces the current value. Does not fire On Change.
focusPasswordMoves focus into the input.

Exposed State

State KeyTypeDescription
{{ id.value }}stringThe current entry — the plain, unmasked text.
{{ id.isFocused }}booleanWhether the input has focus.

Warning: On Focus and On Blur do not include the value in their payload for security — use {{ id.value }} from state instead.

Frequently Asked Questions

What is the difference between a Text Input block and a text field inside a Form?

A standalone Text Input block exposes its value immediately as {{ id.value }} and fires On Change on every keystroke, making it ideal for search bars, filters, and real-time interactions. A text form field is embedded inside a Form block and its value is only included in {{ form.data }} and the submit payload — it's the right choice for data-entry forms where submission as a unit matters.

How do I limit a Text Area to a maximum number of characters?

Add the Max Characters add-on in the Text Area's Content panel. Set the Max Characters value and choose the display style (bottom-right or footer). Note that this is a soft limit — the counter displays how many characters remain but does not block typing past the limit. Use a validity condition in a form field to enforce a hard maximum on submit.

Why does pressing Enter in my Text Area submit the form instead of adding a new line?

Text Area has an Enter submits option that is enabled by default when the block is inside a Form. When this is on, Enter triggers form submission and Shift+Enter inserts a newline. Disable this toggle in the Content panel if you want Enter to always add a newline.

Is the password field's value accessible in On Focus and On Blur events?

No — this is intentional. The Password block's On Focus and On Blur events deliberately exclude the current value from their event payload for security reasons. The value is only accessible via {{ id.value }} in state, not inside focus/blur event handlers.

Can I set the autocomplete type for a password field?

Yes. The Password block has an Autocomplete property with three options: current-password (tells the browser to offer stored passwords), new-password (tells the browser this is a new password field and to offer a generator), and off (disables browser autocomplete). Set it according to whether the field is for logging in or registering.

Step-by-Step Examples

Search Box That Filters a Table

  1. Drop a Text Input; set Placeholder to "Search…" and enable a Start Icon (magnifier).

  2. Filter the table's data source with {{ textinput1.value }}.

  3. Or, for on-demand search, run the data source from On Submit so it fires when the user presses Enter.

Feedback Box with Character Budget

  1. Drop a Text Area; set Placeholder to "Tell us what happened…"

  2. Set Maximum Characters to 500.

  3. On the submit button, add a condition to disable it when {{ textarea1.value.length > 500 }}.

Login Form with Password Block

  1. Add a Text Input for username/email; set Autocomplete appropriately.

  2. Add a Password block; set Autocomplete to current-password so browsers offer saved passwords.

  3. Add a Button. On click, call your authentication data source with {{ emailInput.value }} and {{ password1.value }}.

  4. On success, reset both inputs and navigate.