Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE REQUEST: Allow customised CountrySelector #169

Open
AnderUstarroz opened this issue Mar 20, 2024 · 2 comments
Open

FEATURE REQUEST: Allow customised CountrySelector #169

AnderUstarroz opened this issue Mar 20, 2024 · 2 comments

Comments

@AnderUstarroz
Copy link

AnderUstarroz commented Mar 20, 2024

While this library is lightweight and works great, is not very customisable in terms of aspect, many customers don't like displaying flags within their inputs but this library leaves not alternative. CountrySelector just displays a flag, it would be great if also allows displaying either the country name or country prefix.

Proposed solution
Add option to CountrySelector called display where the allowed options are:

  • Flag (default)
  • Name
  • Prefix

For instance:

Screenshot 2024-03-20 at 10 07 34

Although a perfect solution would be allowing all possible combination of those (flag. + name), (flag + prefix), (flag. + name + prefix), (name + prefix), etc..)

Flag + Name + Prefix:
Screenshot 2024-03-20 at 13 04 00

Would be as easy as adding the new display property within the Country selector API, and making FlagImage optional.

@gustavolbs
Copy link

I fixed this at my PR

But I don't have time to write the tests and follow the guidelines. I'll publish it as personal package and add it here

You can see it working here: https://react-international-phone-git-e93393-yurii-brusentsovs-projects.vercel.app/?path=/story/phoneinput--with-order

Also, I added a new customArrow prop: https://react-international-phone-git-e93393-yurii-brusentsovs-projects.vercel.app/?path=/story/phoneinput--with-custom-arrow

@gustavolbs
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants