Version 2.4.2
v2.4.2Minor Changes#
React 2.4.2#
-
Add
ChakraBaseProvider, a minimal version ofChakraProviderthat supplies just the theme tokens, and ignores components.Historically, one of the biggest causes of the large initial JS payload is the size of the component themes. With this approach, you get to apply the theme for just the component you need by using
extendBaseTheme.Base theme refers to the minimal theme for just the design tokens
import { ChakraBaseProvider, extendBaseTheme } from "@chakra-ui/react"import { Button } from "@chakra-ui/theme/components"const theme = extendBaseTheme({components: {Button,},})function App() {return (<ChakraBaseProvider theme={theme}><Component {...pageProps} /></ChakraBaseProvider>)}
Styled System 2.4.0#
- Add support for
textIndentstyle prop
CLI 2.2.0#
-
Add the flag
--strict-token-typesfor@chakra-ui/cli tokensto generate strict types for theme tokens (e.g. color, spacing)chakra-cli tokens --strict-token-types// before<Box padding="abc" />// valid type, but "abc" is not available in the theme// after<Box padding="abc" /> // invalid// Type '"abc"' is not assignable to type '"1" | "2" | ... | undefined'.
Menu 2.1.5#
-
Added support for setting the initially focused menu programmatically using
initialFocusRef.const Example = () => {const itemRef = useRef(null)return (<Menu initialFocusRef={itemRef}><MenuButton>Welcome</MenuButton><MenuList><MenuItem>Menu 1</MenuItem><MenuItem ref={itemRef}>Menu 2</MenuItem><MenuItem>Menu 3</MenuItem></MenuList></Menu>)}
Button 2.0.13#
-
Added support for
orientationprop in the ButtonGroup component.This makes it possible to now have vertical button groups when
isAttachedis set totrue.<ButtonGroup isAttached orientation="vertical"><Button>Button 1</Button><Button>Button 2</Button><Button>Button 3</Button><Button>Button 4</Button></ButtonGroup>
Icon 3.0.13#
-
Added support for styling the
Iconcomponent from the theme object.const theme = extendTheme({components: {Icon: {width: "auto",},},})
Patch Changes#
Radio 2.0.14#
- Updated type of
valueanddefaultValuetostringinstead ofstring | number. This reflects the internal implementation
Slider 2.0.14#
- Expose
SliderActionsandSliderStatetypes to improve documentation
Theme 2.2.2#
- Fix issue where modal dialog scrolls beyond the content in Safari.
- Fixed css variabled warning with
Tabswhen using the enclosed variant. - Export
baseThemeobject with includes only the theme tokens.
Theme Utilities 2.0.14#
- Replaced
tinycolorpackage withcolor2kfor smaller bundle size
React Types 2.0.5#
- Fixed issue where types were not exported correctly
Gatsby Plugin 3.0.7#
- Fix peer dependency range to support latest version of Gatsby