1010
1111# chakra-react-select v5
1212
13+ This component is a wrapper for the popular react component
14+ [ React Select] ( https://react-select.com/home ) made using the UI library
15+ [ Chakra UI] ( https://v2.chakra-ui.com/ ) .
16+
17+ > [ !IMPORTANT]
18+ >
1319> This version of ` chakra-react-select ` is updated for
1420> [ Chakra UI v2] ( https://v2.chakra-ui.com/getting-started/migration ) which works
1521> exclusively with React v18. ` chakra-react-select ` v3, which is compatible with
3137[ ![ ] ( https://img.shields.io/badge/Code_Style-prettier-c596c7.svg?logo=prettier " Code Style: Prettier ")] ( https://github.com/prettier/prettier )
3238[ ![ ] ( https://badgen.net/github/license/csandman/chakra-react-select " MIT License ")] ( LICENSE.md )
3339
34- This component is a wrapper for the popular react component
35- [ react-select] ( https://react-select.com/home ) made using the UI library
36- [ Chakra UI] ( https://v2.chakra-ui.com/ ) .
37-
3840| Light Mode | Dark Mode |
3941| :-------------------------------------------------: | :-----------------------------------------------: |
4042| ![ Light Mode Demo] ( ./.github/images/demo-light.png ) | ![ Dark Mode Demo] ( ./.github/images/demo-dark.png ) |
@@ -43,11 +45,13 @@ Check out the demo here:
4345
4446[ ![ SB-TS]] ( https://stackblitz.com/edit/vitejs-vite-lzaqwr?file=src%2Fapp.tsx )
4547
46- ** NOTE:** Before leaving an issue on this project, remember that this is just a
47- _ wrapper_ for ` react-select ` , not a standalone package. A large percentage of
48- the questions people have end up being about how ` react-select ` itself works, so
49- please read through their documentation to familiarize yourself with it!
50- https://react-select.com/home
48+ > [ !NOTE]
49+ >
50+ > Before leaving an issue on this project, remember that this is just a
51+ > _ wrapper_ for ` react-select ` , not a standalone package. A large percentage of
52+ > the questions people have end up being about how ` react-select ` itself works,
53+ > so please read through their documentation to familiarize yourself with it!
54+ > https://react-select.com/home
5155
5256## Contents
5357
@@ -94,11 +98,13 @@ npm i @chakra-ui/react @emotion/react@^11.8.1 @emotion/styled@^11 framer-motion@
9498yarn add @chakra-ui/react @emotion/react@^11.8.1 @emotion/styled@^11 framer-motion@^6
9599```
96100
97- ** NOTE:** As of
98- [ ` v3.3.3 ` ] ( https://github.com/csandman/chakra-react-select/releases/tag/v3.3.3 ) ,
99- your project will need to have a minimum of
` @emotion/[email protected] ` installed to
100- avoid having multiple copies of ` @emotion/react ` installed. For more info, see
101- [ PR #115 ] ( https://github.com/csandman/chakra-react-select/pull/115 ) .
101+ > [ !NOTE]
102+ >
103+ > As of
104+ > [ ` v3.3.3 ` ] ( https://github.com/csandman/chakra-react-select/releases/tag/v3.3.3 ) ,
105+ > your project will need to have a minimum of ` @emotion/[email protected] ` installed106+ > to avoid having multiple copies of ` @emotion/react ` installed. For more info,
107+ > see [ PR #115 ] ( https://github.com/csandman/chakra-react-select/pull/115 ) .
102108
103109After Chakra UI is set up,
104110[ install this package from NPM] ( https://www.npmjs.com/package/chakra-react-select ) :
@@ -172,6 +178,8 @@ return (
172178
173179#### ` tagColorScheme `
174180
181+ > [ !NOTE]
182+ >
175183> Renamed from ` colorScheme ` in
176184> [ ` v5.0.0 ` ] ( https://github.com/csandman/chakra-react-select/releases/tag/v5.0.0 )
177185
@@ -346,16 +354,19 @@ highlight color, you can pass the `selectedOptionColorScheme` prop to change it.
346354This prop will accept any named color from your theme's color palette, and it
347355will use the ` 500 ` value in light mode or the ` 300 ` value in dark mode.
348356
349- > ** NOTE:** This prop can only be used for named colors from your theme, not
350- > arbitrary hex/rgb colors. If you would like to use a specific color for the
351- > background that's not a part of your theme, use the
352- > [ ` chakraStyles ` ] ( #chakrastyles ) prop to customize it (see
357+ > [ !NOTE]
358+ >
359+ > This prop can only be used for named colors from your theme, not arbitrary
360+ > hex/rgb colors. If you would like to use a specific color for the background
361+ > that's not a part of your theme, use the [ ` chakraStyles ` ] ( #chakrastyles ) prop
362+ > to customize it (see
353363> [ #99 ] ( https://github.com/csandman/chakra-react-select/discussions/99 ) for an
354364> example).
355365>
356- > Prior to ` v4.6.0 ` this prop was named ` selectedOptionColor ` , and it was
357- > renamed to prevent confusion about its purpose. ` selectedOptionColor ` is still
358- > available but will be removed in the next major version.
366+ > Prior to
367+ > [ ` v4.6.0 ` ] ( https://github.com/csandman/chakra-react-select/releases/tag/v4.6.0 )
368+ > this prop was named ` selectedOptionColor ` , and it was renamed to prevent
369+ > confusion about its purpose.
359370
360371``` tsx
361372return (
@@ -420,9 +431,10 @@ elements.
420431
421432#### ` useBasicStyles ` (removed)
422433
423- This prop was removed in ` v5.0.0 ` , as these styles are now the default styles
424- applied to the component. If you'd like to keep the legacy styles, here are some
425- examples (for each
434+ This prop was removed in
435+ [ ` v5.0.0 ` ] ( https://github.com/csandman/chakra-react-select/releases/tag/v5.0.0 ) ,
436+ as these styles are now the default styles applied to the component. If you'd
437+ like to keep the legacy styles, here are some examples (for each
426438[ ` variant ` ] ( #variant--options-outline--filled--flushed--unstyled--default-outline ) )
427439of how you could accomplish that with the [ ` chakraStyles ` ] ( #chakrastyles ) prop:
428440
@@ -683,8 +695,10 @@ or are themselves those components. As this package pulls directly from your
683695Chakra theme, any changes you make to those components' themes will propagate to
684696the components in this package.
685697
686- > ** NOTE:** Some of the theme styles are manually overridden when this package
687- > implements them. This is necessary for implementing styles for
698+ > [ !NOTE]
699+ >
700+ > Some of the theme styles are manually overridden when this package implements
701+ > them. This is necessary for implementing styles for
688702> [ ` size ` ] ( #size--options-responsivevaluesm--md--lg--default-md ) variants in
689703> components that do not natively have them in Chakra's default theme. This
690704> mostly concerns components that make up the ` Menu ` , but there are a few other
@@ -714,9 +728,11 @@ Here is a list of all components that will be affected by changes to your theme:
714728In addition to specific component styles, any changes you make to your global
715729color scheme will also be reflected in these custom components.
716730
717- > ** NOTE:** Only make changes to your global component themes if you want them
718- > to appear in all instances of that component. Otherwise, just change the
719- > individual components' styles using the ` chakraStyles ` prop.
731+ > [ !NOTE]
732+ >
733+ > Only make changes to your global component themes if you want them to appear
734+ > in all instances of that component. Otherwise, just change the individual
735+ > components' styles using the ` chakraStyles ` prop.
720736
721737### ` className `
722738
@@ -1101,9 +1117,10 @@ const GooglePlacesAutocomplete = () => {
11011117export default GooglePlacesAutocomplete ;
11021118```
11031119
1104- > ** NOTE:** An API key would be needed to create a CodeSandbox example for this
1105- > so you will have to implement it in your own project if you'd like to test it
1106- > out.
1120+ > [ !NOTE]
1121+ >
1122+ > An API key would be needed to create a CodeSandbox example for this so you
1123+ > will have to implement it in your own project if you'd like to test it out.
11071124
11081125## Usage with React Form Libraries
11091126
@@ -1133,7 +1150,9 @@ component or [`useController`](https://react-hook-form.com/api/usecontroller)
11331150hook in order to keep the value(s) tracked in ` react-hook-form ` 's state. Here
11341151are some examples using each:
11351152
1136- > ** NOTE:** These examples still need to be updated to the newest version of
1153+ > [ !NOTE]
1154+ >
1155+ > These examples still need to be updated to the newest version of
11371156> ` chakra-react-select ` at some point, but they should still give you a good
11381157> idea of how to implement what you want.
11391158
@@ -1238,8 +1257,8 @@ issue using one of these templates:
12381257### StackBlitz
12391258
12401259Recently, CodeSandbox severely limited their free tier, so this project has
1241- started to move away from it. Here are a couple StackBlitz templates you can use
1242- as an alternative.
1260+ started to move away from it. Here are a couple
1261+ [ StackBlitz ] ( https://stackblitz.com/ ) templates you can use as an alternative.
12431262
12441263- Vanilla JS Starter:
12451264 https://stackblitz.com/edit/vitejs-vite-fatlrb?file=src%2Fapp.jsx
0 commit comments