Customization
Learn how to customize the configuration of Yamada UI.
To change the prefix of CSS variables, set the value to css.varPrefix.
- 1
Generate a Theme
Use the CLI to generate a theme.
Before running the following commands, you need to install@yamada-ui/cliand execute theinitcommand. For more details, please see here.pnpm yamada-cli themenpm yamada-cli themeyarn yamada-cli themebun yamada-cli theme - 2
Change the Config
Change the
config.tsin the generated theme.theme/config.ts
import { defineConfig } from "@yamada-ui/react" export const config = defineConfig({ css: { varPrefix: "custom" }, breakpoint: { direction: "down", identifier: "@media screen" }, defaultColorMode: "dark", defaultThemeScheme: "base", notice: { duration: 5000 }, theme: { responsive: true }, }) - 3
Update the Provider
Set the generated theme to
UIProvider.import { UIProvider } from "@workspaces/ui" import { theme, config } from "@workspace/theme" const App = () => { return ( <UIProvider theme={theme} config={config}> <YourApplication /> </UIProvider> ) }