aman
aman

Reputation: 133

Modifying width of input field in react day picker input

Is it possible to change the default width of input field of DayPickerInput? If yes, then how can I achieve it? I am not sure if we can do this with overlayComponent.

Upvotes: 5

Views: 5692

Answers (2)

gpbl
gpbl

Reputation: 4804

You can use inputProps to add your props such as style to the input field. See docs: http://react-day-picker.js.org/api/DayPickerInput#inputProps

For example:

<DayPickerInput inputProps={{ style: { width: 200 } }} />

Upvotes: 10

nasaa
nasaa

Reputation: 2731

You can do it by writing your own styles, but first check the stylesheets of day picker here - react-day-picker/lib/style.css and then modify accordingly.

Upvotes: 0

Related Questions