
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
was-this-helpful
Advanced tools
was-this-helpful is a Stencil.js web component that gives you a simple 'Was this helpful?' form.
was-this-helpful is a Stencil.js web component that gives you a simple "Was this helpful?" form. It also allows you send the data any where you want ✨.
<!-- Load the snippet. -->
<script src='<script type="module"src='https://unpkg.com/was-this-helpful@0.0.1/dist/was-this-helpful/was-this-helpful.esm.js'></script>'></script>
<!-- Place the component where you want it. -->
<was-this-helpful></was-this-helpful>
<script>
const wasThisHelpful = document.querySelector('was-this-helpful');
wasThisHelpful.addEventListener('everything', event => {
console.log("An event was triggered:")
console.log(JSON.stringify(event.detail, undefined, 2));
console.log('Now, in JS, you can send the event where ever you want. 🤘')
});
</script>
The component fires the following events:
response - when the user selects 👍 or 👎.feedback - when the user selects a feedback radio input.additional-feedback - when the users submits custom feedback text.everything- when any of the following events above are triggered.Each event will be triggered separately. You can associate them with the session property.
Here is the format of the event data:
{
"time": 1624817229990,
"session": "ae678693-fa67-473e-86d6-e7d62cca72b8",
"event": "response",
"data": "thumbs-up",
"location": {
"href": "http://localhost:3333/",
"path": "/",
"hostname": "localhost"
}
}
<script>
const wasThisHelpful = document.querySelector('was-this-helpful');
wasThisHelpful.addEventListener('everything', event => {
console.log("An event was triggered:")
console.log(JSON.stringify(event.detail, undefined, 2));
console.log('Now, in JS, you can send the event where ever you want. 🤘')
});
</script>
The component can capture feedback in different ways. It can be controlled with an attribute called feedback-style.
none (default) - This style is just the response. That's it.options (recommended) - After the user response, they will be presented radio options for additional input.form - After the user response, they will be presented with a text area for additional input.other - After the user response, they will be presented radio options for additional input with an additional option "Other". If the user selects other, they will be presented with a text area to provide more information.options is recommended because it's less work for the user and still provides you more "why" information. They can select response, and option, and that's it.There are three strategies for using this components:
Place the following script tag in the head of your index.html:
<script src='<script type="module"src='https://unpkg.com/was-this-helpful@0.0.1/dist/was-this-helpful/was-this-helpful.esm.js'></script>'></script>
Then you can use the element anywhere in your template, JSX, html etc
npm install was-this-helpful --save
<script src='node_modules/was-this-helpful/dist/was-this-helpfu.esm.js'></script>
npm install was-this-helpful --save
import was-this-helpful;
After doing one of these, you can use the element anywhere in your template, JSX, html etc
The component exposes the following options:
question - string - change the name of the main question.icon-style - string - change icon style. The icons are from Heroicons. Here are the options:
thumbs (default)emojifeedback-style - string - update the Feedback Style. Here are the options:
none (default)optionsformotherfeedback-question - string - change the name of the feedback question.done-text - update the text the user sees when done giving feedback.session - label the user's session.feedback-style - change how the component gets feedback.happy-feedback - if using options or other, you can provide a comma delineated list of options if the user submits positive feedback.'Easy to understand, Solved my problem'sad-feedback - if using options or other, you can provide a comma delineated list of options if the user submits negative feedback.'Hard to understand, Incorrect information or sample code, Missing the information/samples I need'Example:
<was-this-helpful
question="Am I awesome?"
icon-style="emoji"
feedback-question="Do you have anything left to say?"
done-text="Have a beautiful day!"
></was-this-helpful>
When styling the component, here are the following CSS Variables you can set:
--was-this-helpful-main-color--was-this-helpful-font-familyExample with Dark Mode 🕶️:
<style>
body {
background-color: black;
}
was-this-helpful {
--was-this-helpful-main-color: #D1D5DB;
--was-this-helpful-font-family: 'Inter', sans-serif;
}
@media screen and (prefers-color-scheme: light) {
body {
background-color: white;
}
was-this-helpful {
--was-this-helpful-main-color: #4338CA;
}
}
</style>
FAQs
was-this-helpful is a Stencil.js web component that gives you a simple 'Was this helpful?' form.
We found that was-this-helpful demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.