This tutorial assumes you have already deployed a Base Appchain and installed OnchainKit (version ≥ 0.38.7).
Objectives
By the end of this guide, you will be able to:- Use an LLM to generate a brand-aligned color palette in the OnchainKit CSS format.
- Replace your project’s
globals.css
with the AI-generated theme. - Configure your Next.js layout to import the custom CSS and enable light/dark modes.
- Update the OnchainKit provider to use your custom theme.
Prerequisites
- A deployed Base Appchain
- OnchainKit (version ≥ 0.38.7) installed
- Access to an AI LLM that can process prompts
- Familiarity with Next.js, TypeScript, and CSS
Generate a Color Palette Using AI (optional)
Use the OnchainKit BoilerplateAttach your globals.css example from the OnchainKit docs. You can find the boilerplate here.
Replace Your Global CSS
This guide assumes you have already bootstrapped your project with the OnchainKit Boilerplate. If not, you can do so by running:app/globals.css
with the AI-generated CSS.
Confirm you’re importing globals.css in your root layout (layout.tsx
):
Configure the Root Layout to Apply the Theme
Inlayout.tsx
, wrap your <html>
tag with the light-mode class and apply your background variable:
Enable Your Custom Theme in OnchainKit Provider
Openapp/providers.tsx
and update the provider’s appearance settings:
Run and Verify
- The CSS variables match your brand’s palette
- OnchainKit components including the Bridge widget reflect your custom theme
- Light and dark mode toggle correctly based on user settings

Conclusion
In this tutorial, you learned how to: Use AI to generate a brand-aligned color palette for OnchainKit.- Replace your globals.css with the AI-generated theme.
- Configure your Next.js layout and OnchainKit provider for theming.
- For more details, see the OnchainKit Custom Theme guide.