npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vonage/vc-messages

v2.3.0

Published

vc-messages Web Component to be used with the Vonage Client JS SDK following open-wc recommendations

Readme

<vc-messages>

This Web Component follows the open-wc recommendation and is meant to be used with the Vonage Client SDK In-App Messaging.

A goal is to simplify the code needed to create a chat room quickly. Please see the Creating a chat app tutorial to see an implementation using Vanilla JavaScript.

This Web Component can be used to replace a part of the Chat app UI.

Installation

npm i @vonage/vc-messages

Usage

<script type="module">
  import '@vonage/vc-messages/vc-messages.js';
</script>

<vc-messages></vc-messages>

Attributes that can be used (optional):

  • loadPreviousMessages : set to load any previous messages in the conversation. Default behavior is to load no previous messages.
  • filter : set to filter for only the events you want to load. Default is ['message','member:joined','member:left','member:invited']
<vc-messages loadPreviousMessages="10" filter='["message"]'></vc-messages>

The vc-messages Web Component can handle all its responsibilities in a Conversation.

First, get a reference to the element:

const vcMessages = document.querySelector("vc-messages");

Then, pass the Conversation object to the Web Component:

vcMessages.client = client;
vcMessages.conversationId = conversationId;

Note: To see where conversationId and client came from, see step 4 and step 11 in the tutorial.

Styling

By default, there are no styles applied to the Web Component.

The vc-messages component uses CSS part to apply custom styles.

Here are two diagram that labels the parts of the component as well as the default style:

Diagram labeling the parts of the component

To style the overall message, the part is "message". To style the application user's message, the part to target is "message mine".

Diagram labeling the parts of each message-text of the component

Diagram labeling the parts of each message-image of the component

Each message is made up of the text (part is "message-text") or image (part is "message-image"), and their name (part is "username"). To specifically style the application user's message text, target "message-text mine" or for message image, target "message-image mine". For their name, the target would be "username mine".

To style the image itself, the part is "image". To target the user's image, the part is "image mine".

To get the styling shown in the image:

vc-messages {
  height: 300px;
}

vc-messages::part(message) {
  padding: 15px;
  margin: 5px;
}

vc-messages::part(message mine) {
  text-align: right;
}

vc-messages::part(message-text) {
  border-radius: 6px;
  background-color: #f0f0f0;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px 6px 6px 0;
  font-size: 1.4rem;
}

vc-messages::part(message-text mine) {
  background-color: #e0e0ff;
  border-radius: 6px 6px 0px 6px;
}

vc-messages::part(message-image) {
  background-color: #f0f0f0;
  display: inline-block;
  padding: 8px;
  border-radius: 6px 6px 6px 0;
  font-size: 1.4rem;
  width: 100%;
  max-width: 250px;
}

vc-messages::part(message-image mine) {
  background-color: #e0e0ff;
  border-radius: 6px 6px 0px 6px;
}

vc-messages::part(username) {
  font-size: 1.2rem;
}

vc-messages::part(username mine) {
  text-align: right;
  color: black;
}

Another example could be:

vc-messages {
  background-color: red;
  height: 300px;
}

vc-messages::part(message) {
  background-color: green;
  border-radius: 20px 20px 20px 0;
}

vc-messages::part(message mine) {
  text-align: left;
  background-color: royalblue;
  border-radius: 20px 20px 0 20px;
  border: 0;
}

vc-messages::part(message-text) {
  background-color: yellow;
  border-radius: 20px 20px 20px 0;
}

vc-messages::part(message-text mine) {
  background-color: purple;
  color: white;
  font-style: italic;
  border-radius: 20px 20px 0 20px;
}

vc-messages::part(message-image) {
  background-color: yellow;
  display: inline-block;
  padding: 8px;
  border-radius: 6px 6px 6px 0;
  font-size: 1.4rem;
  width: 100%;
  max-width: 250px;
}

vc-messages::part(message-image mine) {
  background-color: purple;
  border-radius: 6px 6px 0px 6px;
}

vc-messages::part(username) {
  color: white;
}

vc-messages::part(username mine) {
  text-align: right;
  font-style: italic;
  color: black;
}

Tooling configs

For most of the tools, the configuration is in the package.json to minimize the amount of files in your project.

If you customize the configuration a lot, you can consider moving them to individual files.

Local Demo with web-dev-server

npm start

To run a local development server that serves the basic demo located in demo/index.html