eds-nps

Explore the Interactive Component

Use the playground below to experiment with the component. Click the button to view the full Storybook deployment for additional examples and configurations.

eds-nps Open in Storybook

See It in Use with Code

Check out this practical implementation of component.

Plain HTML

Overview

Net Promoter Score: a 0–10 scale drawn as one connected bar of segments, neutral at rest (no red/amber/green tinting, which biases answers), the chosen segment filled. It is a radio group: arrow keys move AND select (and emit), Home/End jump to the ends. The bar shrinks to fit narrow screens instead of wrapping, so the end labels always sit under 0 and 10.

Properties

PropertyAttributeDescriptionTypeDefault
disableddisabledGreyed out and not interactive.booleanfalse
leftLabelleft-labelLabel under 0 (e.g. “Not at all likely”).stringundefined
questionquestionThe question. Shown above the scale and used as the group’s accessible name.stringundefined
rightLabelright-labelLabel under 10 (e.g. “Extremely likely”).stringundefined
selectedValueselected-valueCurrent value, 0–10, or null for none. Controlled from the parent.numbernull

Events

EventDescriptionType
npsEmitted with the chosen value (0–10).CustomEvent<number>

Dependencies

Used by

Depends on

Graph

graph TD;
  eds-nps --> eds-input-label
  eds-form --> eds-nps
  style eds-nps fill:#f9f,stroke:#333,stroke-width:4px

Built with StencilJS