How can I change arrow?
I need another arrow. Example of font-awesome.
How can a change ?
you can use css on .Select-arrow-zone and .Select-arrow
Cool thanks
Would it be possible to allow to pass a custom prop for the arrow so you can for example use svg icons ?
... or to hide altogether; it's in the same location as bootstrap feedback icon.
It's been a while already, but for anyone still having issues with this you can pass a custom function to the property arrowRenderer
You can find an example here: https://github.com/JedWatson/react-select/blob/master/docs/examples/CustomDropdownIndicator.js
Update 2020-12-25: Fixed broken link
How could I change the arrow when it's open?
@MiguelCord looks like the feature has been taken out? The link doesn't work.
Any progress on this issue ?
@Rahulkr204 Came here for the same reason of changing arrow. Maybe this issue could help you: https://github.com/JedWatson/react-select/issues/2926
@matheusalxds @praveenaj @Rahulkr204 @Dracontis
See the docs to learn how to replace components. The one you're looking for is DropdownIndicator.
I solved this by using arrowRenderer props
arrowRenderer() {
return <div className={classes.arrowRenderer}><DownChevron/></div>
}
<Select
arrowRenderer={this.arrowRenderer}
optionRenderer={this.props.optionRenderer}
isMulti={false}
closeMenuOnSelect={false}
options={options}
onChange={(props)=>this.editDropdown(props,name)}
value={value}
className={classes.selectOption}
placeholder={placeholder}
disabled={isDisabled}
clearable={false}
style={dropdownStyle}
/>
@subnomo Thanks. I got it working. Here's my code if anyone still trying to do it.
import Select, { components } from 'react-select';
const DropdownIndicator = props => {
return (
components.DropdownIndicator && (
<components.DropdownIndicator {...props}>
<FontAwesomeIcon icon={props.selectProps.menuIsOpen ? "caret-up" : "caret-down"}/>
</components.DropdownIndicator>
)
);
};
<Select
components={{ DropdownIndicator }}
// pass other props
/>
I wanted to remove the dropdown arrow and by seeing this issue I rendered arrowRenderer as an empty div but there is still an annoying border (or divider something) which used to separate clear and arrow. First anyone has any better solution to remove arrow down icon and second if there is not, how to remove that divider?
Thanks :)
@erfansamieyan That's simple. Just do this in your customStyles Object.

Here's the link to the example on how you can substitute arrow-down with your image: https://react-select.com/components (search for Custom Dropdown Indicator Example)
@praveenaj what is FontAwesomeIcon? I have the following, but passing this in doesn't replace the icon.
const CaretDownIcon = () => {
return <i className="fas fa-caret-down" />;
};
https://codesandbox.io/s/jnk420nmrv
@brendadev https://github.com/FortAwesome/react-fontawesome
I also solved this by passing a function that renders the icon to arrowRenderer props
like so:
const renderIcon = () => (
// return icon render
)
<Select
arrowrenderer={renderIcon}
/>
Is there a simple way to just pass id for dropdownIndicator component, so not to create custom to use existing one but to add html id?
To remove the dropdown indicator in a select add this to your custom styles object.
dropdownIndicator: base => ({
...base,
display: 'none'
}),