Atoms / Scale

Scale

A row of numbers to pick one from: a satisfaction scale, an NPS question.

import { Scale } from "@forgeron/ui";
/01 → Satisfaction
How satisfied are you?
import { Scale } from "@forgeron/ui";

export default function Satisfaction() {
  return (
    <Scale
      label="How satisfied are you?"
      min={1}
      max={5}
      lowLabel="Not at all"
      highLabel="Very"
      defaultValue={4}
    />
  );
}
/02 → Nps
How likely are you to recommend us to a colleague?
import { Scale } from "@forgeron/ui";

export default function Nps() {
  return (
    <Scale
      nps
      label="How likely are you to recommend us to a colleague?"
      lowLabel="Not likely"
      highLabel="Very likely"
      defaultValue={9}
    />
  );
}
API → Props
PropTypeDefaultDescription
labelstring—The question, said once for the whole row.
value / defaultValuenumber | null—Controlled or not.
onChange(value: number | null) => void—On every change.
min / maxnumber0 / 10First and last number.
lowLabel / highLabelstring—Under the first and last number.
npsboolean—Colours the chosen number: 0–6 danger, 7–8 warning, 9–10 success.
readOnlyboolean—Shows the answer.
disabledboolean—Not editable.
classNamestring—Extra classes.