radix-ui / primitives

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
https://radix-ui.com/primitives
MIT License
14.83k stars 717 forks source link

[New Primitive] `DatePicker` #1503

Open ranjithpmankada opened 2 years ago

ranjithpmankada commented 2 years ago

Feature request

Overview

Examples in other libraries

Who does this impact? Who is this for?

Additional context

benoitgrelard commented 2 years ago

@ranjithpmankada I'm guessing you meant "Date" picker right? I've updated the title, but let me know if you meant something else.

nathanielrindlaub commented 1 year ago

If we are in fact talking about a date picker - I too would love to see a primitive for it!

yumin-chen commented 1 year ago

Seems to be a duplicate of https://github.com/radix-ui/primitives/discussions/969 but I too would love to see a date picker and a date range picker primitive too.

abhic91 commented 1 year ago

Seems to be a duplicate of #969 but I too would love to see a date picker and a date range picker primitive too.

until then https://react-spectrum.adobe.com/react-aria/useDatePicker.html

rawnly commented 1 year ago

I recently built my own DateRangePicker combining radix and @h6s/calendar it actually works pretty well and seems to have good accessibility too (is still wip).

I can share a gist if this can help someone ✌️

CleanShot 2022-09-09 at 17 27 20

nathanielrindlaub commented 1 year ago

@Rawnly I'd love to take a look at a Gist!

rawnly commented 1 year ago

@nathanielrindlaub here it is! https://gist.github.com/Rawnly/4ee653d5556ce354c491d20eb1c63027 As i said, is still a POC so no optimisation and code quality might not be the best.

emigdio821 commented 1 year ago

I recently built my own DateRangePicker combining radix and @h6s/calendar it actually works pretty well and seems to have good accessibility too (is still wip).

I can share a gist if this can help someone ✌️

CleanShot 2022-09-09 at 17 27 20

This is looking nice! @Rawnly , do you have an example (CodeSandbox) to see it in action? thanks.

rawnly commented 1 year ago

Hey, @emigdio821 unfortunately I'm not able to post any source code for this since it is for my company. Anyway, using a headless calendar + radix popover does the trick. You may want to use a state machine to handle steps and avoid impossible states :)

a-type commented 1 year ago

I know this is probably not an active pursuit of the team at the moment, but I have a library called calendar blocks which is pretty in-line with the Radix unstyled & composable methodology. I'd be happy to have it 'adopted,' even just absorbed, into Radix if the team is interested.

It mostly does keyboard interaction while staying out of the way in terms of structure and visual design. For example, you could render a single calendar grid, a dual-month view, or even a vertical infinite list of dates, all of which utilize the same underlying state values.

CleanShot 2023-04-13 at 14 13 15

tannermann commented 1 year ago

Support for new date/time/datetime primitives

Brenndoerfer commented 10 months ago

Would love to see this, too

udaya28 commented 9 months ago

Waiting for date and time picker primitive can someone suggest any headless date and time picker for react?

rawnly commented 9 months ago

@udaya28 i used @h6s/calendar

snovos commented 2 months ago

Any update? Its been almost a year since initial feature request was opened. Seems like datepicker is in high demand within community

DarioLopes commented 1 month ago

Shadcn has it, patiently waiting for this to come to our beloved Radix 😄

sersavan commented 2 weeks ago

Hi, try this one assembled with shadcn

https://shadcn-calendar-component.vercel.app

image