Skip to content

Is there a way to use the main style of chakra ui as props? #96

Answered by csandman
Thiago-spart asked this question in Q&A
Discussion options

You must be logged in to vote

I think what you're looking for is the chakraStyles prop, it lets you style each element using native chakra styles.

https://github.com/csandman/chakra-react-select#chakrastyles


I just made an example for how you'd do that using the component you provided, but you'd probably need to tweak the styles of more of the sub-components to make it look like you want.

CodeSandbox: https://codesandbox.io/s/chakra-react-select-custom-control-styles-gfnlo9?file=/example.js

import { FormControl, FormLabel } from "@chakra-ui/react";
import { Select } from "chakra-react-select";
import { groupedOptions } from "./data/data";

const Example = () => (
  <FormControl p={4}>
    <FormLabel>chakra-react-sele…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by csandman
Comment options

You must be logged in to vote
0 replies
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 #80 on May 05, 2022 19:14.