Text Area Field Type
Description:
The text_area
field type provides a multi-line text input for users to enter longer blocks of text. It is ideal for capturing detailed information, comments, descriptions, or any content that may span multiple lines. This field type offers more space than a standard single-line text field, enhancing the user experience when dealing with larger text inputs.
YAML Definition
- name: comments
type: text_area
display_name: "Comments"
guidance: "Enter any additional information or comments."
required: false
default_value: ""
max_length: 500
readonly: false
Attributes
-
name (string): Required.
The unique identifier for the field. -
type (string): Required.
Must be set totext_area
for text area fields. -
display_name (string): Optional.
The label displayed to the user in the interface. If not provided, a formatted version ofname
is used. -
guidance (string): Optional.
Instructions or help text for the field, assisting users in understanding what to enter. -
required (boolean): Optional.
Iftrue
, the field must be filled before submission. -
default_value (string): Optional.
The default text displayed when the form is first loaded. -
max_length (number): Optional.
Specifies the maximum number of characters allowed in the text area. -
readonly (boolean): Optional.
Iftrue
, the field is displayed as read-only and cannot be edited by the user. -
hidden (boolean): Optional.
Iftrue
, the field is hidden from the user interface.
Example
- name: project_description
type: text_area
display_name: "Project Description"
guidance: "Provide a detailed description of the project objectives and scope."
required: true
default_value: ""
max_length: 1000
In this example:
- project_description: Captures a detailed description of a project.
- max_length: Limits the input to 1000 characters to ensure concise entries.
- required: Ensures that the user provides this essential information before submission.
Usage Notes
- User Interaction:
- The text area provides a larger input field suitable for multi-line text.
- Users can enter paragraphs of text, which can include line breaks and extended descriptions.
- Default Values:
- Use
default_value
to pre-fill the text area with placeholder text or default content. - This can guide users on what information to provide or offer a template to follow.
- Use
- Validation:
- If
required
istrue
, validation should ensure that the text area is not left empty upon submission. - Use
max_length
to restrict the number of characters and prevent excessively long entries. - Implement validation to provide user feedback if the input exceeds
max_length
.
- If
- Readonly Fields:
- Setting
readonly
totrue
displays the content without allowing user edits. - Useful for displaying information that should not be modified, such as system-generated notes.
- Setting
- Guidance and Labels:
- Provide a clear
display_name
to describe the purpose of the field. - Use the
guidance
attribute to offer additional instructions or expectations for the content.
- Provide a clear
- Use Cases:
- Comments or Feedback: Collecting user comments, feedback, or suggestions.
- Descriptions: Capturing detailed descriptions for tasks, issues, or items.
- Instructions: Allowing users to enter step-by-step instructions or procedures.
- Notes: Providing a space for users to record notes or observations.
- Formatting and Styling:
- Text areas accept plain text input by default.
- If formatting is required (e.g., bold, italics), consider using a
rich_text
field instead.
- Accessibility:
- Ensure that the text area is accessible via keyboard navigation.
- Labels and guidance should be clear for users utilizing assistive technologies.
- Internationalization:
- Support input in multiple languages and character sets.
- Be mindful of character limits (
max_length
) when dealing with languages that use multi-byte characters.
- Performance Considerations:
- For fields expecting very long text inputs, consider how the data will be stored and displayed.
- Ensure that the application can handle large amounts of text without performance degradation.
By incorporating the text_area
field type into your schema, you provide users with an intuitive way to input longer text entries, enhancing the flexibility and usability of your application when capturing detailed information.