Comment

The Comment component provides a reusable pattern for comment in the interface.

Comment Thread Example

The comment can be used as a top level comment and as a reply.

Peter Svensson

This is a comment text

Peter Olsson

This is a reply comment text

Peter Olsson

This is a reply comment text, it was written now.

Peter Olsson

This is a reply comment text, it was written two minutes ago.

Peter Olsson

This is a reply comment text, it was written five hours ago.

PS
This comment content was sent through the slot.

API

Parameter Default Description
Name of the commenter
URL to the profile of the author
A link to an image
Content of the comment
Which icon to show
dark Color for comment bubble background: light or dark
01/02/2019 The date when the comment was posted
ago Time elapsed 'since'
[] Array containing translations valid keys: year, month, week, day, hour, minute, second
[] Array containing translations valid keys: year, month, week, day, hour, minute, second
div Element of the component
false If true the comment will be displayed as a reply
false If set to true the comment will be filtered from html tags
Which tags should be excluded from filtration

CSS API

Variable Default Type Values Description
var(--space) range - Base spacing unit. Used for padding and margin inside components.
var(--outer-space) range - Spacing between components. Use --space for spacing inside components.
var(--border-radius) range - Border Radius
var(--color--surface) color - Surface
var(--corner-shape) select square, round, squircle, circular, bevel, scoop Corner Shape
var(--color--surface-contrast) color - Used for text and icons on surface backgrounds with less contrast.
var(--color--background-contrast-muted) color - Derived muted contrast for text and icons on background surfaces.
var(--font-size-90) range - One step below base in the type scale.