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 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.
Peter Svensson
This comment content was sent through the slot.
API
| Parameter | Default | Description |
|---|---|---|
|
author
|
Name of the commenter | |
|
author_url
|
URL to the profile of the author | |
|
author_image
|
A link to an image | |
|
text
|
Content of the comment | |
|
icon
|
Which icon to show | |
|
bubble_color
|
dark | Color for comment bubble background: light or dark |
|
date
|
01/02/2019 | The date when the comment was posted |
|
date_suffix
|
ago | Time elapsed 'since' |
|
dateLabels
|
[] | Array containing translations valid keys: year, month, week, day, hour, minute, second |
|
dateLabelsPlural
|
[] | Array containing translations valid keys: year, month, week, day, hour, minute, second |
|
componentElement
|
div | Element of the component |
|
is_reply
|
false | If true the comment will be displayed as a reply |
|
filterHtml
|
false | If set to true the comment will be filtered from html tags |
|
allowedTags
|
|
Which tags should be excluded from filtration |
CSS API
| Variable | Default | Type | Values | Description |
|---|---|---|---|---|
|
--c-comment--space
|
var(--space) | range | - | Base spacing unit. Used for padding and margin inside components. |
|
--c-comment--outer-space
|
var(--outer-space) | range | - | Spacing between components. Use --space for spacing inside components. |
|
--c-comment--border-radius
|
var(--border-radius) | range | - | Border Radius |
|
--c-comment--color--surface
|
var(--color--surface) | color | - | Surface |
|
--c-comment--corner-shape
|
var(--corner-shape) | select | square, round, squircle, circular, bevel, scoop | Corner Shape |
|
--c-comment--color--surface-contrast
|
var(--color--surface-contrast) | color | - | Used for text and icons on surface backgrounds with less contrast. |
|
--c-comment--color--background-contrast-muted
|
var(--color--background-contrast-muted) | color | - | Derived muted contrast for text and icons on background surfaces. |
|
--c-comment--font-size-90
|
var(--font-size-90) | range | - | One step below base in the type scale. |
Peter Svensson
This is a comment text