Display
Display static, non-editable information from a form.
Examples
Usage
Display static, non-editable information within a form, enabling users to review details clearly without the ability to change them. This helps distinguish non-interactive content from editable fields and supports a clear, accessible interface. This is crucial for forms that include review or confirmation steps, allowing users to check information without risk of accidental edits.
Common use cases:
- showing previously submitted information for review
- displaying calculated or system-generated values
- presenting read-only data alongside editable fields
- summaries in multi-step forms or wizards
- print-friendly or export views from form data
Do:
- use the display component to visually distinguish static content from editable fields
- use instead of read only form inputs if the data in the input will never be editable
- use the format '23 October 1995' when displaying a date, spelling out the month in full
- use semantic HTML elements to ensure screen readers announce the content correctly
- stack content vertically
Avoid:
- when users need to edit or interact with content or data
- using it to show frequently changing dynamic data, unless users are clearly informed about those changes
Parameters for turas-display
- asp-for - Binds the display to a model property
- field-column-widths - Sets the column width for the display
- additional-classes -Adds custom CSS classes to the display
- custom-label - Specifies a custom label for the display
- hide-label - Hides the label for the display if set to true
- text-container-id - Sets a custom ID for the text container
- raw: - Displays the raw value without encoding
- asp-format - Formats the displayed value according to the specified format string