Search code examples
react-bootstrap-typeahead

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


Solution

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

    <Typeahead
      ...
      inputProps={{
        className: 'my-custom-classname',
        style: {
          'backgroundColor': 'red',
        }
      }}
    />