Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

A working thread

Use a discussion on a record for comments, replies, reactions and mentions that people answer.

Comments with replies
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.
Show code
<app-comment-thread comments="@Model.Comments" action="?handler=Comment" people="@Model.People" />

public IActionResult OnPostComment(string intent, string commentId, string parentId, string body, string emoji)
{
    // intent: post | reply | edit | delete | react. Check the viewer may do it, apply it,
    // notify MentionText.Ids(body), then answer the thread as this viewer now sees it.
    return this.CommentItems(LoadComments());
}

Refused changes

Show the reason when a post is refused, such as a thread whose comments are closed.

Comments closed

No comments yet.

Show code
return this.ActionRefused("Comments are closed on this ticket.");

Simpler threads

Turn off replies and reactions for a plain list of comments, and place the box inline for a quick reply.

Comments without replies
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.
Show code
<app-comment-thread comments="@Model.Comments" action="?handler=Comment" people="@Model.People" allow-replies="false" allow-reactions="false" />
Inline composer

No comments yet.

Show code
<app-comment-thread comments="@Array.Empty<CommentItem>()" action="?handler=Comment" people="@Model.People" composer="Inline" author="Asha Rao" post-label="Post" />

Read-only

Show an archived discussion without the box, actions or reactions, when the record is closed.

Archived thread
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    👀2👍1
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
      🎉3
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.
Show code
<app-comment-thread comments="@Model.Comments" read-only />

Conversation

Use chat bubbles for a ticket thread, with the viewer's own messages on the right.

Ticket thread
  1. Priya Sharma
    The invoice PDF will not open on my phone.
  2. Arjun Mehta
    Thanks, Priya. I can reproduce it and I am on it.
  3. Arjun MehtaInternal note
    The PDF is generated without fonts embedded; checking the template.
Show code
<app-comment-thread comments="@ticket" variant="Conversation" read-only />

Markdown bodies

Set markdown to draw each comment as Markdown, for a team whose comments are written with lists, bold and links.

Markdown comments
  1. Asha Rao
    **Totals** ok, @Ravi Kumar please confirm:
    
    - the GST line
    - the *rounding*
    1. Ravi Kumar
      Done, `OK`.
Show code
<app-comment-thread comments="@Model.Comments" markdown="true" read-only />

Every option

Every value of every prop, one cell each.

comments: the list, oldest first

comments="[]"

No comments yet.

comments with replies, reactions and a deleted comment
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

action: the URL each change posts to

action="?handler=Comment"
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

onPost: a new comment

onPost (React form): saves a new comment, posted to action
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

onReply: a reply to a top-level comment

onReply (React form): saves a reply under its comment
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

onEdit: a changed body

onEdit (React form): saves the changed body
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

onDelete: a delete

onDelete (React form): removes a comment after the person confirms
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

onReact: a reaction

onReact (React form): toggles this person's reaction
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

people: the people the box offers when a mention is typed

people: three people

No comments yet.

people="[]": nobody is offered

No comments yet.

loadPeople: a lookup that returns people for a query

people-source="/Components/AppCommentThread?handler=People" (Razor form of loadPeople)

No comments yet.

loadPeople (React form): looks people up as the person types

No comments yet.

reactionChoices: the reactions the panel offers

reaction-choices omitted (default)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.
reaction-choices="👍 ✅ ❓"
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

allow-replies: true or false

allow-replies="true" (default)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.
allow-replies="false"
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

allow-reactions: true or false

allow-reactions="true" (default)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.
allow-reactions="false"
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

composer-placeholder: a string

composer-placeholder omitted (default)

No comments yet.

composer-placeholder="Reply to the ticket"

No comments yet.

variant: list or conversation

variant="list" (default)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    👀2👍1
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
      🎉3
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.
variant="conversation"
  1. Priya Sharma
    The invoice PDF will not open on my phone.
  2. Arjun Mehta
    Thanks, Priya. I can reproduce it and I am on it.
  3. Arjun MehtaInternal note
    The PDF is generated without fonts embedded; checking the template.

composer: stacked or inline

composer="stacked" (default)

No comments yet.

composer="inline"

No comments yet.

author: the name on the inline composer's avatar

author="Asha Rao" (inline composer only)

No comments yet.

post-label: the post button's text

post-label="Comment" (default)

No comments yet.

post-label="Send"

No comments yet.

composer-rows: a number of rows

composer-rows omitted (default: 3 stacked, 1 inline)

No comments yet.

composer-rows="6"

No comments yet.

read-only: true or false

read-only="false" (default)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.
read-only="true"
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    👀2👍1
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
      🎉3
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

markdown: true or false

markdown="false" (default)
  1. Asha Rao
    **Totals** ok, @Ravi Kumar please confirm: - the GST line - the *rounding*
    1. Ravi Kumar
      Done, `OK`.
markdown="true"
  1. Asha Rao
    **Totals** ok, @Ravi Kumar please confirm:
    
    - the GST line
    - the *rounding*
    1. Ravi Kumar
      Done, `OK`.

label: the list's accessible name

label="Discussion" (accessible name, not drawn)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    👀2👍1
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
      🎉3
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

internal-label: the text on an internal note

internal-label="Staff only"
  1. Priya Sharma
    The invoice PDF will not open on my phone.
  2. Arjun Mehta
    Thanks, Priya. I can reproduce it and I am on it.
  3. Arjun MehtaStaff only
    The PDF is generated without fonts embedded; checking the template.

attachments-label: the heading above attached files

attachments-label="Files"
  1. Priya Sharma
    The invoice PDF will not open on my phone.
  2. Arjun Mehta
    Thanks, Priya. I can reproduce it and I am on it.
  3. Arjun MehtaInternal note
    The PDF is generated without fonts embedded; checking the template.

id: the root's id

id (React only): Razor generates the root id
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    👀2👍1
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
      🎉3
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

linkComponent: a router link for in-app links

linkComponent (React form): Razor uses a plain href
  1. Priya Sharma
    The invoice PDF will not open on my phone.
  2. Arjun Mehta
    Thanks, Priya. I can reproduce it and I am on it.
  3. Arjun MehtaInternal note
    The PDF is generated without fonts embedded; checking the template.

composer-label: the name of the new-comment box

composer-label="Write a reply" (accessible name, not drawn)

No comments yet.

no-comments-text: shown when there are no comments

no-comments-text="Nothing here yet."

Nothing here yet.

reactions-label: the name of a comment's reactions

reactions-label="Emoji" (accessible name, not drawn)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    👀2👍1
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
      🎉3
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

replies-to-label: the name of a reply list

replies-to-label="Answers to {name}" (accessible name, not drawn)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    👀2👍1
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
      🎉3
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

edited-label: marks an edited comment

edited-label="Changed"
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    👀2👍1
    1. Meera IyerChanged
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
      🎉3
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

deleted-text: shown in place of a deleted comment

deleted-text="Removed by the author."
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    👀2👍1
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
      🎉3
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    Removed by the author.

reply-label: the Reply action

reply-label="Answer"
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

edit-label: the Edit action

edit-label="Change"
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

delete-label: the Delete action and its confirm button

delete-label="Remove"
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

delete-confirm-text: the question before a delete

delete-confirm-text="Remove this comment?" (shown after Delete)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

cancel-label: cancels a delete

cancel-label="Keep" (shown after Delete)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

add-reaction-label: the add-reaction button

add-reaction-label="React" (accessible name, not drawn)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

choose-reaction-label: the reaction panel

choose-reaction-label="Pick a reaction" (accessible name, not drawn)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

people-label: the mention menu in the composer

people-label="Team" (accessible name, not drawn)
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.

className: extra classes on the root

class="analytics-thread" (React: className, on the root, not drawn)

No comments yet.

Guidance

What to do, and what to avoid.

Use it when

  • Discussion on a work item, ticket or approval.
  • Any record people talk about and mention each other on.

Reach for something else when

  • A log of what changed and who changed it. → AppTimeline
  • A live conversation with an assistant. → a chat thread in the chat package

Reference

Try every prop, read the full list, and check keyboard and screen reader behaviour.

Your thread Empty
?handler=Comment ?handler=Closed (refuses)
people: four people: none people-source: lookup
allow-replies: on allow-replies: off
allow-reactions: on allow-reactions: off
variant: list variant: conversation
composer: stacked composer: inline
  1. Ravi Kumar
    The invoice totals look off by ₹1,250. @Meera Iyer can you check the GST line?
    1. Meera IyerEdited
      Found it: the rate was 12% instead of 18%. Fixed and re-sent.
  2. Asha Rao
    Thanks both. @Ravi Kumar please close the ticket once the client confirms.
  3. Arjun Mehta
    This comment was deleted.
React, generated from the controls
<AppCommentThread comments={comments} people={people}
  
  
  
  
  onPost={post} onReply={reply} onEdit={edit}
  onDelete={remove} onReact={react} />
Razor, the same props
<app-comment-thread comments="@Model.Comments" action="/Components/AppCommentThread?handler=Comment" people="@Model.People" />

32 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
commentsdefault - IReadOnlyList<CommentItem> - Top-level comments, oldest first: Id, Author, At (shown in IST), Value, Edited, Deleted, CanEdit, CanDelete, Reactions, Replies.
peopledefault - IEnumerable<MentionPerson> - The people the boxes offer after @.
reaction-choicesdefault 👍 ❤️ 🎉 😄 👀 🙏 string 👍 ❤️ 🎉 😄 👀 🙏 The reactions the panel offers, separated by spaces.
allow-repliesdefault true bool true False leaves out the Reply action and the reply box; existing replies still show.
allow-reactionsdefault true bool true False leaves out the reaction panel and the reaction chips.

Less common 27 props

PropTypeDefaultDescription
actiondefault - string - Where every change POSTs: intent, commentId, parentId, body, emoji. Required unless read-only.
read-onlydefault false bool false Show the thread without the box, actions or reacting.
people-sourcedefault - string - An address that answers people as the person types (GET with q).
markdowndefault false bool false Draws each comment body as Markdown (bold, italics, lists, links, code); raw HTML shows as text and a mention reads as plain @Name. Unset, bodies show as plain text. Pass the same value to CommentItems.
composer-placeholderdefault Write a comment. Type @ to mention someone. string Write a comment. Type @ to mention someone. The composer box's placeholder. Without it the standard placeholder asks for a comment and names @ mentions.
variantdefault list list | conversation list list: every comment down one column. conversation: chat bubbles, this person's own on the right.
composerdefault stacked stacked | inline stacked stacked: the box under the list. inline: one row with the author's avatar, the box and the post button.
authordefault - string - The name for the inline composer's avatar. Ignored when stacked.
post-labeldefault Comment string Comment The post button's text.
composer-rowsdefault 3 stacked, 1 inline int 3 stacked, 1 inline The composer box's rows. Without it, 3 stacked and 1 inline.
labeldefault Comments string Comments The list's accessible name.
internal-labeldefault Internal note string Internal note Replaces the built-in English text, for other languages.
attachments-labeldefault Attachments string Attachments Replaces the built-in English text, for other languages.
composer-labeldefault Add a comment string Add a comment Name of the new-comment box. Replaces the built-in English text, for other languages.
no-comments-textdefault No comments yet. string No comments yet. Shown when there are no comments. Replaces the built-in English text, for other languages.
reactions-labeldefault Reactions string Reactions Name of a comment's reaction group. Replaces the built-in English text, for other languages.
replies-to-labeldefault Replies to {name} string Replies to {name} Name of a reply list; {name} is the author. Replaces the built-in English text, for other languages.
edited-labeldefault Edited string Edited Marks an edited comment. Replaces the built-in English text, for other languages.
deleted-textdefault This comment was deleted. string This comment was deleted. Shown in place of a deleted comment. Replaces the built-in English text, for other languages.
reply-labeldefault Reply string Reply The Reply action. Replaces the built-in English text, for other languages.
edit-labeldefault Edit string Edit The Edit action. Replaces the built-in English text, for other languages.
delete-labeldefault Delete string Delete The Delete action and its confirm button. Replaces the built-in English text, for other languages.
delete-confirm-textdefault Delete this comment? string Delete this comment? The question before a delete. Replaces the built-in English text, for other languages.
cancel-labeldefault Cancel string Cancel Cancels a delete. Replaces the built-in English text, for other languages.
add-reaction-labeldefault Add a reaction string Add a reaction Name of the add-reaction button. Replaces the built-in English text, for other languages.
choose-reaction-labeldefault Choose a reaction string Choose a reaction Name of the reaction panel. Replaces the built-in English text, for other languages.
people-labeldefault People string People Name of the mention menu in the composer. Replaces the built-in English text, for other languages.

Screen reader

3 notes
  • Changes to the thread are announced to screen readers.
  • Ctrl or Cmd+Enter sends a box and Escape closes it and returns focus.
  • The label prop is the list's accessible name.