Add template for automatic country selection #453
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A common need when using this library is to automatically select the user's country based on their IP or location. Since that's out of scope for this library (there's no reliable way to detect the user's country on the client side alone), I put together a simple template that integrates it with an external service.
The template uses Croct, which offers a free-forever plan and makes it super easy to detect the user’s country from their IP. We've been using it in all our contact forms, and it’s been super helpful for improving UX by pre-filling the country field automatically.
I also added a new section to the README with a one-line setup and usage example:
Here's what it looks like in action:

Hope this helps others who’ve run into the same need!