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.
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
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
disabled | disabled | Greyed out and not interactive. | boolean | false |
leftLabel | left-label | Label under 0 (e.g. “Not at all likely”). | string | undefined |
question | question | The question. Shown above the scale and used as the group’s accessible name. | string | undefined |
rightLabel | right-label | Label under 10 (e.g. “Extremely likely”). | string | undefined |
selectedValue | selected-value | Current value, 0–10, or null for none. Controlled from the parent. | number | null |
Events
| Event | Description | Type |
|---|---|---|
nps | Emitted 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