Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Bootstrap Typeahead - setting input styles

This is a great component - just wondering if there's a simple way to apply css styles to the actual input element? e.g. to set the background colour via a prop

like image 748
tyddynonn Avatar asked Sep 13 '26 08:09

tyddynonn


1 Answers

You can use inputProps to apply props directly to the input component:

<Typeahead
  ...
  inputProps={{
    className: 'my-custom-classname',
    style: {
      'backgroundColor': 'red',
    }
  }}
/>
like image 149
ericgio Avatar answered Sep 15 '26 03:09

ericgio



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!