Skip to content

Style option in dropdown? #182

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

You must be logged in to vote

I can't tell exactly what you're trying to do, but what you're probably looking for is the chakraStyles prop. Something along these lines should do the trick, but I'm not sure how you have your custom components set up.

return (
  <Select
    chakraStyles={{
      option: (provided) => ({
        ...provided,
        _first: {
          pt: 0
        },
        _last: {
          pb: 0
        }
      })
    }}
  />
)

Here's a demo of the prop in action, obviously without the custom components: https://codesandbox.io/s/chakra-react-select-option-styles-6g16yc?file=/example.js

If you need further help, please make a CodeSandbox reproduction of what you have so far and I can give a better e…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by QuangLoc0311
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