Skip to content

Customize the background color of focused custom Option components #45

Answered by csandman
paddyfink asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks very much for this library. It is exactly what I was looking for.

I'm glad you like it 😀


So it looks like you are importing the components object that is exported by the original package. I'm currently exporting both that and the custom components used by this package to give people the freedom of using whatever they want from either.

If you'd like to wrap my theme aware option component, try importing it like this:

import { Select, chakraComponents } from "chakra-react-select";

const IconOption = (props) => (
  <chakraComponents.Option label={props.data.name} {...props}>
    <Flex align="center">
      <Image
        w="20px"
        h="20px"
        src={`${process.env.PUBLIC…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@csandman
Comment options

@paddyfink
Comment options

Answer selected by paddyfink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants