Comments

The Comments pattern enables users to post, view, and interact with user-generated content, such as feedback, discussions, or reviews.

Example showing comments.
  • Facilitate team communication, feedback, or discussion within an application.
  • Capture collaborative notes and reminders in shared contexts.
  • Maintain an auditable discussion log.
  • Suitable for forums, activity feeds, support threads, and collaborative workspaces.

At the top level, Comments consists of an input for adding new comments and a running list that shows the conversation history, so users can review prior messages.

Each comment tile can include:

  1. Author: Display name
  2. Avatar (optional): Initials or image identifying the commenter.
  3. Supporting details: Metadata such as timestamp, an optional user role, or an “Edited” indicator.
  4. Content: Main body of the comment.
Comments anatomy

Use StackLayout to display the input and the comments list.

comments layout

Include when identity cues improve scanning or clarify ownership.

  • Avatar: Show a photo; fall back to initials. Keep size and placement consistent.
  • Role: Use a short, standardized role or title.
comments with avatars

Use the Avatar component’s categorical colors to differentiate authors.

comments with user roles

Always show a timestamp and the last edit time.

comments with time stamp
Best practices
  • Display “edited” with the last edit time; keep the original creation timestamp visible.
  • Use locale‑aware formatting and the viewer’s time zone.

Use a short, neutral message to indicate there are no comments yet.

Comments with empty state
Best practices
  • Use direct language that sets expectations (for example, “No comments yet.”).
  • Keep it compact; avoid decorative imagery or filler.

Use a MultilineInput when longer messages are common; this reduces scrolling while composing.

Comments with multiline input
Best practices
  • Use a multiline field only if a meaningful portion of users will benefit.
  • Auto‑grow to a sensible maximum height, then scroll within the field so the thread stays visible.

Choose the order that best fits the task.

  • Newest-first (default for ongoing threads): Surfaces the latest activity immediately; ideal for long‑running discussions over days or weeks.
  • Oldest-first: Preserves chronological reading; best for short, time‑boxed reviews where sequence matters.
Comments display order

Offer recovery without losing work by showing an inline error. Preserve the failed comment text.

Comments with submission error
Best practices
  • Use clear, actionable copy that states what happened and what the user can do next.
  • Provide Retry and Dismiss actions; keep the message visible until resolved.
  • Support stacked errors if multiple submissions fail.

If you need to expand the pattern or share feedback with us, please contact the team.