-
-
Notifications
You must be signed in to change notification settings - Fork 743
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
Question: How to add icon to DayPickerInput #998
Comments
You can pass a custom component to render in place of the provided input. See the component property in the documentation: http://react-day-picker.js.org/api/DayPickerInput Usage example:
Your custom input might look something like this:
Your base html inputs will need some styling on of course. |
Also note that the code above will be buggy, you will want to also handle forwarding the ref on to your custom input. |
Handling the refs in TypeScript if it helps anyone: Also fixes the issue #977
With your "MyInput" component looking like:
|
I have tried several things in an attempt to add a calendar icon to the
DayPickerInput
without success. I'd be great if we had an easier way to do so. Perhaps a prop on it?Can you provide an example using a
component
or aclassName
? I'm currently using thereact-icons
package.thanks in advance
The text was updated successfully, but these errors were encountered: