# NPS Strip

> A 0 to 10 recommend score on one track: the pick slides between scores in its group's colour, a band below lights the group, and the follow-up question changes for detractors, passives and promoters.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › Feedback |
| Live preview | https://uibrik.com/components/nps-strip |
| Writes | 1 file into `components/uibrik/nps-strip/` |
| Packages | `@tabler/icons-react`, `motion`, `react-use-measure` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 23, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/nps-strip.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/nps-strip`.

Can't run commands? https://uibrik.com/components/nps-strip/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { NpsStrip } from "@/components/uibrik/nps-strip/nps-strip";

const prompt = "How likely are you to recommend us to a friend?";

const followUps = ["What would have made it better?", "What would make it a 10?", "What do you love most?"];

<NpsStrip
  prompt={prompt}
  lowLabel="Not likely"
  highLabel="Very likely"
  colors={["#e5484d", "#e8890c", "#16a35a"]}
  width={460}
  defaultValue={null}
  segmentLabels={["Detractor", "Passive", "Promoter"]}
  followUps={followUps}
  placeholder="Tell us a little more"
  submitLabel="Send"
  thanksLabel="Thanks for the feedback"
  onSubmit={(feedback) => {}}
  // value={0}
  // onChange={(score) => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/nps-strip.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `prompt` | `string` | `"How likely are you to recommend us to a friend?"` | The question above the scores. |
| `lowLabel` | `string` | `"Not likely"` | Word under 0. |
| `highLabel` | `string` | `"Very likely"` | Word under 10. |
| `colors` | `string[]` | `["#e5484d","#e8890c","#16a35a"]` | Colour of detractors (0 to 6), passives (7 to 8) and promoters (9 to 10). |
| `width` | `number` | `460` | Width of the card; never wider than its container. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `value / onChange` | `number \| null / (score) => void` |  | Controlled score from 0 to 10, null for none. |
| `defaultValue` | `number \| null` | `null` | Score on mount when uncontrolled. |
| `segmentLabels` | `[string, string, string]` | `["Detractor", "Passive", "Promoter"]` | Name of each group, shown as a chip once picked. |
| `followUps` | `[string, string, string]` |  | Follow-up question for each group. |
| `onSubmit` | `(feedback: { score, segment, comment }) => void \| Promise` |  | Called when sent. Return a promise to hold the button in a sending state; a rejection keeps the card open. |
| `placeholder / submitLabel / thanksLabel` | `string` |  | Note placeholder, send button text and the line shown once sent. |
| `className` | `string` |  | Classes for the wrapper. |

## Where it fits

- **Quarterly NPS surveys**: The whole survey is one card, and each group is asked the question that matters for it.
- **In-app feedback prompts**: Eleven scores fit a phone-width card without wrapping or scrolling. Pairs with [Toast](https://uibrik.com/components/toast.md).
- **Post-onboarding check**: The coloured band shows people which group their score falls in as they pick.

## Same shelf: Feedback

- [Pin Comment](https://uibrik.com/components/pin-comment.md) (Pro): Comment mode for any part of a page: a dock below the content turns it on, an outline glides to whatever is under the pointer and names it, a click drops a pin with your face and a composer that records the element and position, and pins open into threads you can resolve.
- [Rating Feedback](https://uibrik.com/components/rating-feedback.md) (Pro): A pill of stars that grows into a card: a low rating asks what went wrong, a high one opens a review box, and sending folds it into a thank-you pill whose check draws itself.
- [Effort Dial](https://uibrik.com/components/effort-dial.md): A gauge for customer effort scores: a gradient arc fills from green toward red as the knob follows your finger, ticks light as it passes, it settles into the nearest answer, and a hard answer asks what got in the way.
- [Feature Votes](https://uibrik.com/components/feature-votes.md) (Pro): A ranked, scrolling board of feature requests: a vote rolls the count and glides the row to its new rank with a chip for how far it climbed, coloured status pills filter the list, and opening a row shows the details, who voted and a thread you flip through by tapping faces, with a reply field.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/nps-strip/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
