Go to homepage

Projects /

Comments

Threaded comments template.

View Demo

Dependencies

How to

The Comments component is used to display a threaded comments section. It's often positioned at the end of blog posts (or similar content types).

Comment Likes #

When a user likes a comment (clicking the .js-comments__vote-btn element), a custom newVote event is emitted:

var commentBtnVote = document.getElementsByClassName('js-comments__vote-btn')[0]; // first comment vote Btn

commentBtnVote.addEventListener('newVote', function(event) {
  // user liked te comment
  // event.detail.count -> new value of cmment likes
  // event.detail.upVote -> true if the user liked the comment
});

Categories

Bug report & feedback

Component Github page ↗

Project duplicated

Project created

Globals imported

There was an error while trying to export your project. Please try again or contact us.