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

Improve docs #115

Open
AndryOre opened this issue Oct 14, 2023 · 3 comments
Open

Improve docs #115

AndryOre opened this issue Oct 14, 2023 · 3 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@AndryOre
Copy link

AndryOre commented Oct 14, 2023

I think the docs should be improved because it is a bit confusing how the api works.
Specifically, I am confused about the styles.

            <PhoneInput
              countrySelectorStyleProps={{ buttonClassName: 'px-2' }}
              defaultCountry="us"
              inputClassName={`w-full ${isValid ? '' : 'border-red-500'}`}
              onChange={(e) => {
                handlePhoneNumber(e);
              }}
              inputProps={{
                onBlur: () => {
                  isPhoneValid(`+${phoneNumber}`);
                },
              }}
            />

I'm trying to access 'listItemClassName' and I can't access it.
It would be nice to have examples.

@viheag
Copy link

viheag commented Oct 27, 2023

Same, I would like to know how to use it with react-hook-form

@goveo goveo added good first issue Good for newcomers documentation Improvements or additions to documentation labels Oct 27, 2023
@goveo
Copy link
Owner

goveo commented Oct 27, 2023

@AndryOre Sorry for the late response.
Yea, this part is not well written, I'll add styling examples when I have time, thanks!

You can access it in this way:

<PhoneInput
  countrySelectorStyleProps={{
    dropdownStyleProps: {
      listItemClassName: 'some-class-name',
    },
  }}
/>

@goveo
Copy link
Owner

goveo commented Oct 27, 2023

Same, I would like to know how to use it with react-hook-form

@viheag You can use the storybook story code as an example for now:
https://github.com/goveo/react-international-phone/blob/master/src/stories/Validation.stories.tsx#L69

I will update the docs with some examples when I have time, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants