shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
68.57k stars 4.06k forks source link

[feat]: input number #4385

Closed zhouzi closed 3 weeks ago

zhouzi commented 1 month ago

Feature description

The browser's input[type=number] is quite bad in terms of user experience.

And implementing a proper one is not trivial.

It would be ideal for shadcn/ui to provide one.

Affected component/components

Input, Form

Additional Context

Radix doesn't have a number field yet, it's being tracked in this issue:

Other popular libraries do have it, for example:

React Aria's NumberField page is a great summary of all the intricacies and references the W3C's specs:

I found a few standalone libraries, the most popular that's been updated recently is:

Other solutions are:

And here are a few issues referencing the number input's behavior with shadcn/ui:

Before submitting

zhouzi commented 1 month ago

Curious to know what's the team's opinion on the matter:

  1. Either shadcn/ui waits for the number input to land in radix-ui
  2. Or it provides it through a standalone library

I could probably help with solution 2.

shadcn commented 3 weeks ago

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

zhouzi commented 3 weeks ago

This issue should be kept open until the component becomes available or the team decides to not include it at all.