Skip to content

Add NumberField component#575

Merged
mkernohanbc merged 55 commits intomainfrom
feature/numberField
Jan 14, 2026
Merged

Add NumberField component#575
mkernohanbc merged 55 commits intomainfrom
feature/numberField

Conversation

@mkernohanbc
Copy link
Copy Markdown
Contributor

This PR implements a new NumberField component, using RAC NumberField as its base.

Examples are included in the Vite kitchen sink app, along with examples and tech docs in Storybook:

Screenshot 2025-12-04 at 2 28 31 PM

A NumberField is composed from RAC's Group and Input components and the existing BCDS Button component. A numerical value can be entered via increment/decrement buttons, keyboard or using the scroll-wheel.

The formatOptions prop enables developers to define specific unit types and formatting (eg. currency or distance). Additionally, it also includes a unitLabel prop that renders an additional text label next to the input, intended for use with custom units not supported in Intl.NumberFormat().

It supports the same form validation/submission and error-handling methods (via the isInvalid and errorMessage props) as our other input components. Developers can set minValue and/or maxValue to constrain the range of acceptable values. The step prop can also be used to set the increment 'tick'.

@mkernohanbc mkernohanbc marked this pull request as ready for review December 9, 2025 19:29
@mkernohanbc
Copy link
Copy Markdown
Contributor Author

Tagging @Philip-Cheung for design review and @Supriya-Arora for code review! Will merge once you both approve.

@Philip-Cheung
Copy link
Copy Markdown

Screenshot 2025-12-09 at 11 49 10 AM Screenshot 2025-12-09 at 11 52 04 AM

Check to see if the disabled text in the number value and units are using the disabled type token

@mkernohanbc
Copy link
Copy Markdown
Contributor Author

mkernohanbc commented Dec 9, 2025

Check to see if the disabled text in the number value and units are using the disabled type token

Fixed in bab4634

@mkernohanbc
Copy link
Copy Markdown
Contributor Author

Temporarily removing all unit tests — this branch doesn't have the Vitest config, will refactor tests for this component as part of #599.

@mkernohanbc mkernohanbc requested review from ty2k and removed request for Supriya-Arora January 5, 2026 19:10
Copy link
Copy Markdown
Contributor

@ty2k ty2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome component! 🚀 Couple suggestions below.

Comment thread packages/react-components/src/components/NumberField/NumberField.tsx Outdated
Comment thread packages/react-components/src/stories/NumberField.mdx Outdated
@mkernohanbc mkernohanbc requested a review from ty2k January 12, 2026 17:24
Copy link
Copy Markdown
Contributor

@ty2k ty2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@mkernohanbc mkernohanbc merged commit 5891540 into main Jan 14, 2026
5 checks passed
@mkernohanbc mkernohanbc deleted the feature/numberField branch January 28, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Components Changes or issues affect the design-system-react-components package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Number field

4 participants