diff --git a/docs/chakra-migration-guide.md b/docs/chakra-migration-guide.md index dae5cc0a2e9..7e9c93541b9 100644 --- a/docs/chakra-migration-guide.md +++ b/docs/chakra-migration-guide.md @@ -8,6 +8,63 @@ This is part of our [UI library implementation epic](https://github.com/ethereum All `styled` components need to be removed and replaced with the corresponded Chakra component. [See the list of components](https://chakra-ui.com/docs/components). +Use as much native Chakra components as possible. + +### Wrappers or layout divs + +Use the [native layouts components](https://chakra-ui.com/docs/components/box) + +```tsx +// before +const Wrapper = styled.div` + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +` + +// now + +``` + +Center things using the `
` component + +```tsx +// before +const Center = styled.div` + height: 100px; + display: flex; + justify-content: center; + align-items: center; +` + +// now +
+``` + +Group buttons using `` or `` + +```tsx +// before +const ButtonRow = styled.div` + display: flex; + align-items: center; + flex-wrap: wrap; +` + +// now + + + + + +// or + + + + +``` + ## Override styles using style props - You can see how to use the different style props here: [https://chakra-ui.com/docs/styled-system/style-props](https://chakra-ui.com/docs/styled-system/style-props#margin-and-padding)