nextui-org / nextui

🚀 Beautiful, fast and modern React UI library.
https://nextui.org
MIT License
20.46k stars 1.24k forks source link

[Feature Request] Add selectorButtonPlacement prop to DatePicker component #3015

Open maxsynnott opened 1 month ago

maxsynnott commented 1 month ago

Is your feature request related to a problem? Please describe.

Currently the DatePicker component always renders the selectorButton on the right side of the input and there is no way of changing this placement.

I suggest adding a prop to allow the placement to be modified

I think this feature is pretty necessary to align with other inputs that are using icons in their startContent prop.

Describe the solution you'd like

I think there should be a new prop on the DatePicker component like so:

selectorButtonPlacement?: "left" | "right" // default "right"

Describe alternatives you've considered

I've currently hacked around it using css but it's not pretty

<DatePicker
    ...
    className="date-picker-left-selector-button"
    ...
/>
.date-picker-left-selector-button [data-slot="inner-wrapper"] {
    flex-direction: row-reverse;
    column-gap: 0;
}

.date-picker-left-selector-button [data-slot="selector-button"] {
    justify-content: start;
}
Screenshot 2024-05-17 at 4 29 17 PM

Screenshots or Videos

No response

linear[bot] commented 1 month ago

ENG-846 [Feature Request] Change placement of selectorButton on DatePicker component