Skip to content

how i can set selectedOptionColor as hexa #99

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

You must be logged in to vote

So the name of the prop selectedOptionColor is kind of a misnomer. It should really be selectedOptionColorScheme because it applies a color from your theme depending on whether your app is in light or dark mode. If you want to set the color to a specific hex color, you should use the chakraStyles prop to customize it.

Here's an example of how you could accomplish that: https://codesandbox.io/s/chakra-react-select-selected-option-color-1k9ob3?file=/example.js

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

const Example = () => (
  <Select
    name="colors"
    options={groupedOptions}
    placeholder="Select some colors..."
    closeMenuOnSelect={false}
    chakraStyles={{
      option: (p…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@csandman
Comment options

Answer selected by csandman
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
Converted from issue

This discussion was converted from issue #77 on May 05, 2022 19:22.