razorpay / blade

Design System that powers Razorpay
https://blade.razorpay.com
MIT License
513 stars 143 forks source link

Feature Request: Option to Hide Clear Button in Search Input #2377

Open Akshay090 opened 1 month ago

Akshay090 commented 1 month ago

Description: Currently, the Search Input component does not provide an option to hide the clear (cross) button. You can view the current implementation in the Storybook.

Screenshot for Reference:

Clear Button in Search Input

Reason for Request: In certain UI layouts, such as when the search input is placed inside a bottom sheet that already contains a close (cross) icon, the clear button in the search input appears redundant. This visual repetition can lead to a cluttered design, making it preferable to have an option to hide the clear button in such scenarios.

Example of the Issue: Here’s an example of how the search input looks within a bottom sheet containing its own close button:

Screenshot 2024-10-16 at 11 30 27 AM

Proposed Solution: Introduce a prop or option to conditionally hide the clear button in the Search Input component to avoid this visual redundancy.

reachaadrika commented 1 month ago

Hey @Akshay090 , Can I work on this ? Kindly assign this to me Thanks

rkdotdesign commented 1 month ago

While both buttons are positioned near each other, they serve distinct functions. The button on the bottomSheet closes the sheet entirely, while the button on the searchInput clears the entered text. For users actively engaged in searching, providing a direct option to clear their input enhances the overall user experience.

Rather in cases like these can we try using the bottomSheet header to avoid scenarios like these where 2 dismiss buttons are in such close proximity?