Change Proposal: Increment/Decrement Spinner Buttons for `NumberInput`
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start by reviewing the existing NumberInput component and its current numberMode, minValue, and maxValue behavior, then inspect open pull request #271 to understand the work already underway. Done means optional spinner buttons support the proposed step and visibility settings, clamp values to the limits, and leave existing usages unaffected.
Written by the indexing model from the issue text.
Description
What is being proposed?
Add optional up/down spinner buttons to NumberInput so users can nudge a numeric value by a configurable step, instead of only being able to type a value directly.
Why is this needed?
NumberInput currently only accepts typed input. For small, discrete adjustments (e.g. incrementing an integer count), typing is slower and more error-prone than a click-to-step control, which is a common affordance for numeric fields. There was previously no way to adjust the value without full keyboard entry.
What will change?
-
Behaviour:
NumberInputcan now render a vertical up/downButtonGroupinside the field as an end adornment. Clicking increases/decreases the current value by step, clamped tominValue/maxValue. Buttons disable automatically at the limits. -
New props:
step?: number: the increment/decrement amount, defaults to1.spinnerButtons?: "always" | "onHover" | "never": controls spinner visibility. Defaults to"onHover"for all number modes except"scientific", which defaults to"never"(since stepping isn't a natural operation on scientific-notation values).- No new component: this extends the existing
NumberInput.
Interface changes (if any)
Additive/optional only — existing usages of NumberInput are unaffected.
<NumberInput
label="Quantity"
numberMode="natural"
step={1}
spinnerButtons="always" // "always" | "onHover" | "never"
/>
Breaking change?
- Yes
- No
Next steps
A maintainer will review this issue.
If accepted, it will be marked as accepted and a PR may then be opened.
- Dominant language
- TypeScript
- Stars
- 9
- Forks
- 3
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 20
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DiamondLightSource/sci-react-ui
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
DiamondLightSource/sci-react-ui#325 · 1 comment ·
Maintainers usually reply within 2 days
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
DiamondLightSource/sci-react-ui#283 ·
Maintainers usually reply within 2 days
-
needs-triage
Difficulty 3/5 1-2 days Newbie friendliness 65/100
DiamondLightSource/sci-react-ui#334 ·
Maintainers usually reply within 2 days
-
needs-triage
Difficulty 5/5 Over a week Newbie friendliness 38/100
DiamondLightSource/sci-react-ui#332 ·
Maintainers usually reply within 2 days
-
needs-triage
Difficulty 5/5 Over a week Newbie friendliness 35/100
DiamondLightSource/sci-react-ui#331 ·
Maintainers usually reply within 2 days
All issues in DiamondLightSource/sci-react-ui
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
betagouv/mon-entreprise#4699 ·
Maintainers usually reply within 3 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jaegertracing/jaeger-ui#4547 · 3 comments ·
Maintainers usually reply within 1 day
-
ai-driven-qa
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
linagora/twake-calendar-frontend#1467 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
need4deed-org/sdk#267 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
auth0/universal-login#414 ·
Maintainers usually reply within 1 day