Text Area Field Type

Description:
The text_area field type provides a multi-line text input area for users to enter longer text content. It is suitable for capturing descriptions, notes, comments, or any content that requires more space than a single-line text field. This field type allows for comfortable text entry and editing of longer content within your application.

Elasticsearch Mapping: keyword (indexed)


YAML Definition

- name: description
  type: string
  display: text
  display_name: "Description"
  default_value: "Enter description here..."
  required: false
  readonly: false
  hidden: false
  guidance: "Provide a detailed description of the issue"
  size: large

Attributes

  • name (string): Required.
    The unique identifier for the field.

  • type (string): Required.
    Must be set to string for text area fields.

  • display (string): Required.
    Must be set to text for text area display.

  • display_name (string): Optional.
    The label displayed to the user in the interface. If not provided, a formatted version of name is used.

  • guidance (string): Optional.
    Instructions or help text for the field, assisting users in understanding what to enter.

  • required (boolean): Optional.
    If true, the field must be filled before submission. Default: false.

  • readonly (boolean): Optional.
    If true, the field is displayed as read-only and cannot be edited by the user. Default: false.

  • hidden (boolean): Optional.
    If true, the field is hidden from the user interface. Default: false.

  • default_value (string): Optional.
    The default text displayed when the form is first loaded.

  • size (string): Optional.
    Field size specification. Options: small, medium, large. Default: medium.


Examples

Basic Text Area Field:

- name: description
  type: string
  display: text
  display_name: "Description"
  default_value: "Enter description here..."
  required: false
  guidance: "Provide a detailed description of the issue"
  size: large

Required Text Area Field:

- name: project_summary
  type: string
  display: text
  display_name: "Project Summary"
  required: true
  guidance: "Provide a comprehensive summary of the project"
  size: large

Readonly Text Area Field:

- name: notes
  type: string
  display: text
  display_name: "Notes"
  readonly: true
  default_value: "These notes are read-only and cannot be edited."
  size: medium

Usage Notes

  • User Interaction:
    • The text area provides a multi-line input field for longer text content.
    • Users can enter and edit text comfortably with support for line breaks and paragraphs.
    • The field automatically expands to accommodate the content being entered.
  • Display Type:
    • Use display: text to enable the text area interface.
    • The field type remains string but the display determines the input behavior.
  • Size Options:
    • small: Compact text area suitable for short content.
    • medium: Standard size for most use cases.
    • large: Extended text area for detailed content and longer text.
  • Default Values:
    • Use default_value to pre-fill the field with placeholder text or instructions.
    • Helpful for providing examples or guidance on what to enter.
  • Validation:
    • If required is true, ensure that the field is not left empty.
    • Consider implementing character limits or content validation as needed.
  • Readonly Fields:
    • Setting readonly to true displays the content without allowing user edits.
    • Useful for displaying system-generated content or information that should not be modified.
  • Guidance and Labels:
    • Provide clear display_name to help users understand what to enter.
    • Use the guidance attribute to offer additional instructions or examples.
  • Use Cases:
    • Descriptions: Detailed descriptions of cases, products, or services.
    • Notes and Comments: User notes, observations, or comments.
    • Summaries: Project summaries, case summaries, or report content.
    • Instructions: Step-by-step instructions or procedures.
    • Feedback: User feedback, reviews, or testimonials.
  • Data Handling:
    • Text area content is stored as plain text with preserved line breaks.
    • Consider text processing for display (e.g., converting line breaks to HTML).
  • Accessibility:
    • Ensure that the text area is accessible via keyboard navigation.
    • Provide clear labels that screen readers can interpret.
    • Consider providing character count or other helpful indicators.
  • Performance Considerations:
    • For very large text content, consider implementing character limits.
    • Monitor performance when handling multiple large text areas on a single form.

By incorporating the text_area field type into your schema, you provide users with a comfortable and efficient way to enter longer text content, enhancing the data collection capabilities of your application.


Copyright © 2025 Caseblocks Limited.