Skip to content

Theming

This setup allows the user to define partial theme colors. That means it’s not required to specify every color — only the ones you wish to customize. Any colors not explicitly defined will automatically fall back to the default values.

Import necessary modules and create a custom theme configuration.

import { StrictMode } from "react"
import { createRoot } from "react-dom/client"
import App from "./App"
import { Provider, createTheme } from "@dxdns-kit/react"
const theme = createTheme({
colors: { light: { bg: "orange" } }
})
createRoot(document.getElementById("root")!).render(
<StrictMode>
<Provider theme={theme}>
<App />
</Provider>
</StrictMode>
)

You can access and use theme colors throughout your components. For example, you might want to use colors defined in the theme for different parts of your app.

light

  • primary:
  • onPrimary:
  • secondary:
  • onSecondary:
  • muted:
  • bg:
  • onBg:
  • surface:
  • onSurface:
  • border:
  • disabled:
  • onDisabled:
  • skeleton:
  • onSkeleton:
  • overlay:
  • shadow:
  • success:
  • onSuccess:
  • error:
  • onError:
  • warning:
  • onWarning:
  • info:
  • onInfo: