users
Description
Optional. Provides a list of users that can be associated with commentsUsage
users?: {
id: string | number;
name?: string;
avatar?: string;
color?: string;
}[];
Parameters
id
- (required) unique identifier of the username
- (optional) displays the name of a useravatar
- (optional) URL of the user's avatar imagecolor
- (optional) the color used for styling the user's comments
Example
Initializing comments widget with data and list of users:
<script>
import { Comments } from '@svar-ui/svelte-comments';
const value = [
{
id: "1",
content: "Hello, world!",
user: 1,
date: new Date(),
},
];
const users = [
{ id: 1, name: "John Doe" },
{ id: 2, name: "Jane Doe" },
];
</script>
<Comments {value} {users} />