Theme
The theme object is where you define your application's color palette, type scale, font stacks, breakpoints, border radius values, and more. You can either create your own theme object or use theme that provide from refine. You can find more information about theme in Chakra UI documentation.
Refer to the Chakra UI documentation for more information about theme. →
Predefined Themes
RefineThemes
has predefined themes for you. You can use them by importing them from @refinedev/chakra-ui
package. It is not required if you decide to use the default chakra-ui theme.
const { Blue, Purple, Magenta, Red, Orange, Yellow } = RefineThemes;
import { Refine } from "@refinedev/core";
import { ThemedLayout, RefineThemes } from "@refinedev/chakra-ui";
import { ChakraProvider } from "@chakra-ui/react";
const App: React.FC = () => {
return (
<ChakraProvider theme={RefineThemes.Blue}>
<Refine
/* ... */
>
<ThemedLayout>{/* ... */}</ThemedLayout>
</Refine>
</ChakraProvider>
);
};
If you want to use <ThemedLayout>
you have to wrap your application with <ChakraProvider>
component and should give theme
prop to it.
You can use RefineThemes
provided by refine or you can create your own theme object.
Refer to the Chakra UI documentation for more information about theme. →
Theme customization
<ChakraProvider/>
component can be used to change the theme and other global settings. It is not required if you decide to use the default theme. You can also use RefineThemes
provided by refine.
Theme switching
Chakra UI comes with built-in support for managing color mode in your apps. You can manage the color mode on refine applications such as Chakra UI applications.
Chakra stores the color mode in localStorage
and appends a className to the body to ensure the color mode is persistent.
Refer to the Chakra UI documentation for more information about color mode. →
If you want to customize the default layout elements provided with @refinedev/chakra-ui
package, check out the Custom Layout tutorial.