Customize
Theme
Colours, fonts, corner radius and the agent orb, all passed in through CartesianTheme.
The UI is drawn with Compose Foundation only. It does not read your Material theme, so nothing leaks in either direction. Everything visual comes from CartesianTheme.
val theme = CartesianTheme.Builder()
.colors(
CartesianColors.Builder()
.background(Color(0xFFFFFFFF))
.accent(Color(0xFF0F7B3F)) // links, focus, highlights
.primary(Color(0xFF0F7B3F)) // primary buttons, user bubble
.onPrimary(Color.White)
.build(),
)
.fontFamily(FontFamily(Font(R.font.brand_regular), Font(R.font.brand_medium, FontWeight.Medium)))
.displayFontFamily(FontFamily(Font(R.font.brand_display)))
.cornerRadius(16.dp)
.build()
Cartesian.initialize(this, config, CartesianOptions.Builder().theme(theme).build())let theme = CartesianTheme(
colors: CartesianColors(background: .white, accent: Color(hex: 0x0F7B3F), primary: Color(hex: 0x0F7B3F)),
fontFamily: .custom(regular: "Brand-Regular", medium: "Brand-Medium", semibold: "Brand-SemiBold"),
displayFontFamily: .custom("BrandDisplay"),
cornerRadius: 16
)
Cartesian.configure(config, options: CartesianOptions(theme: theme))const options = {
theme: {
colors: { background: "#FFFFFF", accent: "#0F7B3F", primary: "#0F7B3F", onPrimary: "#FFFFFF" },
fontFamily: "Brand, system-ui, sans-serif",
displayFontFamily: "BrandDisplay, serif",
cornerRadius: 16,
},
};
<CartesianProvider client={cartesian} options={options}>…</CartesianProvider>Every builder starts from the Cartesian defaults, so you only set what you want to change. To adjust an existing theme, use toBuilder():
val darker = CartesianTheme.DEFAULT.toBuilder().showOrb(false).build()kotlinColours
| Token | Default | Used for |
|---|---|---|
background | #FEFAF1 | Panel and chat background |
surface | #FFFFFF | Cards, composer, chips |
surfaceMuted | #F5F1E7 | Image wells, subtle fills |
line | #E9E5DC | Hairlines and borders |
lineStrong | #D6D2C9 | Focused and stronger borders |
ink | #000000 | Primary text |
inkMuted | #5E5E5E | Secondary text |
inkSubtle | #757575 | Captions, placeholders |
inkFaint | #9E9E9E | Disabled text, attribution |
accent | #004CFF | Links, focus rings, emphasis |
primary / onPrimary | #000000 / #FFFFFF | Primary buttons, send button |
sale | #8C2B2B | Sale prices, errors |
success / successSoft | #2F6A4A / #EEF4F0 | Cart confirmations |
badge | #8C2B2B | Count badges |
For a dark theme, build a second CartesianColors and choose between them with isSystemInDarkTheme() when you build the options. Pass the result to the surface, for example CartesianChat(options = …).
Typography
| Property | Default | Used for |
|---|---|---|
fontFamily | Spline Sans (400/500/600) | All body and UI text |
displayFontFamily | Spline Sans | Welcome heading, prices |
emphasisFontFamily | IBM Plex Serif Italic | The emphasised word in the welcome heading |
Use any font
Every piece of text in the assistant, including answers, cards, chips and the composer, reads its font from the theme. So any font your app can load works. Pick whichever way you already ship fonts:
Put the files in res/font and reference them:
val brand = FontFamily(
Font(R.font.brand_regular, FontWeight.Normal),
Font(R.font.brand_medium, FontWeight.Medium),
Font(R.font.brand_semibold, FontWeight.SemiBold),
)
CartesianTheme.Builder()
.fontFamily(brand)
.displayFontFamily(brand)
.emphasisFontFamily(FontFamily(Font(R.font.brand_italic, style = FontStyle.Italic)))
.build()kotlinNo files in your APK. Add androidx.compose.ui:ui-text-google-fonts and the font certificates array, then:
val provider = GoogleFont.Provider(
providerAuthority = "com.google.android.gms.fonts",
providerPackage = "com.google.android.gms",
certificates = R.array.com_google_android_gms_fonts_certs,
)
val poppins = FontFamily(
Font(GoogleFont("Poppins"), provider, FontWeight.Normal),
Font(GoogleFont("Poppins"), provider, FontWeight.Medium),
Font(GoogleFont("Poppins"), provider, FontWeight.SemiBold),
)
CartesianTheme.Builder().fontFamily(poppins).displayFontFamily(poppins).build()kotlinAdd the font files to your app target and list them under UIAppFonts in Info.plist (or use any system font):
CartesianTheme(
fontFamily: .custom(regular: "Brand-Regular", medium: "Brand-Medium", semibold: "Brand-SemiBold"),
displayFontFamily: .system(design: .serif),
emphasisFontFamily: .custom("Brand-Italic")
)swiftYou can also pass a closure: CartesianFontFamily { size, weight in .custom("Brand", fixedSize: size).weight(weight) }. Sizes follow Dynamic Type.
Load the font as you normally do (@font-face, Google Fonts, next/font), then pass any CSS font stack:
theme: {
fontFamily: "Poppins, system-ui, sans-serif",
displayFontFamily: "Poppins, system-ui, sans-serif",
emphasisFontFamily: "Lora, Georgia, serif",
}tsxOr override the CSS variable --cx-font on .cartesian-root from your own stylesheet.
// From assets/fonts
val fromAssets = FontFamily(Font("fonts/Brand-Regular.ttf", context.assets))
// Or a system family
CartesianTheme.Builder().fontFamily(FontFamily.SansSerif).build()kotlinProvide Normal (400), Medium (500) and SemiBold (600) weights. The assistant uses all three. A missing weight is synthesised by Android, which looks blurrier.
Try any of them live in the Playground.
Shape and motion
cornerRadius(default12.dp) is the base radius for cards and inputs. Chips and buttons stay pill-shaped.showOrb(defaulttrue) controls the animated agent orb that shows what the assistant is doing: searching, comparing, composing and so on. Set it tofalsefor a calmer UI. The text trace is still shown.




