Skip to content

Is it possible to style "<chakraComponents.Option"? #320

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

You must be logged in to vote

Yeah, the easiest way to style it would be to use the chakraStyles prop. Even if you're using a custom wrapper for it, the chakraStyles will still apply.

        <Select
          chakraStyles={{
            option: (base) => ({
              ...base,
              backgroundColor: 'blue.200',
            }),
          }}
        />

Here's a demo: https://stackblitz.com/edit/vitejs-vite-qd93qr?file=src%2Fapp.tsx

Replies: 1 comment

Comment options

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