logo

Comment

A comment displays user feedback and discussion to website content.

When To Use

Comments can be used to enable discussions on an entity such as a page, blog post, issue or other.

Examples

A basic comment with author, avatar, time and actions.

expand code expand code

Displaying a series of comments using the antd List Component.

expand code expand code

Comments can be nested.

expand code expand code

You can set the placement of the avatar to achieve the dialogue style.

expand code expand code

Comment can be used as an editor, so the user can customize the contents of the component.

expand code expand code

Comment API#

Property Description Type Default Value
Author ParameterAuthor string String --
AuthorTemplate ParameterAuthor content. Takes priority over AntDesign.Comment.Author RenderFragment --
Avatar ParameterAvatar string. Gets passed as the AntDesign.Avatar.Src to the Avatar component. String --
AvatarTemplate ParameterAvatar content. Takes priority over AntDesign.Comment.Avatar RenderFragment --
Content ParameterContent string for the comment String --
ContentTemplate ParameterContent for the comment. Takes priority over AntDesign.Comment.Content RenderFragment --
ChildContent ParameterUsed primarily for nesting comments for functionality such as replies RenderFragment --
Datetime ParameterDate string for the comment String --
DatetimeTemplate ParameterDate content for the comment. Takes priority over AntDesign.Comment.Datetime RenderFragment --
Actions ParameterList of actions to show at the bottm of the comment IList<RenderFragment> --
Placement ParameterSets the direction of the comment. left or right. String left
Id ParameterID for the component's HTML String Uniquely Generated ID
Class ParameterSpecifies one or more class names for an DOM element. String --
Style ParameterSpecifies an inline style for a DOM element. String --
RefBack ParameterA ForwardRef instance. You can get a reference to the internal DOM by using AntDesign.ForwardRef.Current. ForwardRef --
Collapse Descriptions
文档已更新,请点击 此处 更新。
A new version of this app is available. Click here to update.