Cartesiandocs

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.

9:41

FreshMart

Delivering to Home · 94107 · in 45 min

🥛Dairy
🥦Produce
🍞Bakery
🥩Meat
🍿Snacks

Lucerne Farms Eggs Large

$1.29

Wilcox Family Farm Organic Brown Eggs

$1.29

O Organics Sharp Cheddar Sliced

$2.99

Horizon Organic String Cheese

$5.99

FreshMart Assistant

Eggs and cheese for breakfast, add the cheapest eggs

SM
Searched eggs
Searched cheese
Viewed4 products

Here's a quick breakfast basket. The cheapest eggs are Lucerne Farms Large at $1.29, so I added a carton to your cart.

For cheese, the O Organics sharp cheddar slices are $2.99. If the kids want something to grab, Horizon string cheese is $5.99 for six.

4 results

Lucerne Farms Eggs Large

6 Count · Eggs

$1.29

$0.22/ct

Usual

Wilcox Family Farm Organic Brown Eggs

12 Count · Eggs

$1.29

$0.11/ct

O Organics Sharp Cheddar Sliced

6 Oz · Cheese

$2.99

$0.50/oz

Horizon Organic String Cheese

6 Count · Cheese

$5.99

$1.00/ct

Added 1 item to your cart

FreshMart Assistant can make mistakes. Please check prices and ingredients before you buy.

Powered byCogitX Cartesian
Cartesian defaults
9:41

FreshMart

Delivering to Home · 94107 · in 45 min

🥛Dairy
🥦Produce
🍞Bakery
🥩Meat
🍿Snacks

Lucerne Farms Eggs Large

$1.29

Wilcox Family Farm Organic Brown Eggs

$1.29

O Organics Sharp Cheddar Sliced

$2.99

Horizon Organic String Cheese

$5.99

FreshMart

Eggs and cheese for breakfast, add the cheapest eggs

SM
Searched eggs
Searched cheese
Viewed4 products

Here's a quick breakfast basket. The cheapest eggs are Lucerne Farms Large at $1.29, so I added a carton to your cart.

For cheese, the O Organics sharp cheddar slices are $2.99. If the kids want something to grab, Horizon string cheese is $5.99 for six.

4 results

Lucerne Farms Eggs Large

6 Count · Eggs

$1.29

$0.22/ct

Usual

Wilcox Family Farm Organic Brown Eggs

12 Count · Eggs

$1.29

$0.11/ct

O Organics Sharp Cheddar Sliced

6 Oz · Cheese

$2.99

$0.50/oz

Horizon Organic String Cheese

6 Count · Cheese

$5.99

$1.00/ct

Added 1 item to your cart

FreshMart can make mistakes. Please check prices and ingredients before you buy.

Powered byCogitX Cartesian
FreshMart brand: green primary, white background, 20dp radius
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())

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()
kotlin

Colours

TokenDefaultUsed for
background#FEFAF1Panel and chat background
surface#FFFFFFCards, composer, chips
surfaceMuted#F5F1E7Image wells, subtle fills
line#E9E5DCHairlines and borders
lineStrong#D6D2C9Focused and stronger borders
ink#000000Primary text
inkMuted#5E5E5ESecondary text
inkSubtle#757575Captions, placeholders
inkFaint#9E9E9EDisabled text, attribution
accent#004CFFLinks, focus rings, emphasis
primary / onPrimary#000000 / #FFFFFFPrimary buttons, send button
sale#8C2B2BSale prices, errors
success / successSoft#2F6A4A / #EEF4F0Cart confirmations
badge#8C2B2BCount 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

PropertyDefaultUsed for
fontFamilySpline Sans (400/500/600)All body and UI text
displayFontFamilySpline SansWelcome heading, prices
emphasisFontFamilyIBM Plex Serif ItalicThe 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()
kotlin

Provide Normal (400), Medium (500) and SemiBold (600) weights. The assistant uses all three. A missing weight is synthesised by Android, which looks blurrier.

9:41

FreshMart

Delivering to Home · 94107 · in 45 min

🥛Dairy
🥦Produce
🍞Bakery
🥩Meat
🍿Snacks

Lucerne Farms Eggs Large

$1.29

Wilcox Family Farm Organic Brown Eggs

$1.29

O Organics Sharp Cheddar Sliced

$2.99

Horizon Organic String Cheese

$5.99

FreshMart Assistant

What's on your grocery list?

Tell me what you're cooking or who you're feeding. I'll find the products, compare prices, plan meals around your diet and allergies, and fill your cart.

FreshMart Assistant can make mistakes. Please check prices and ingredients before you buy.

Powered byCogitX Cartesian
Default: Spline Sans + Plex Serif italic
9:41

FreshMart

Delivering to Home · 94107 · in 45 min

🥛Dairy
🥦Produce
🍞Bakery
🥩Meat
🍿Snacks

Lucerne Farms Eggs Large

$1.29

Wilcox Family Farm Organic Brown Eggs

$1.29

O Organics Sharp Cheddar Sliced

$2.99

Horizon Organic String Cheese

$5.99

FreshMart Assistant

What's on your grocery list?

Tell me what you're cooking or who you're feeding. I'll find the products, compare prices, plan meals around your diet and allergies, and fill your cart.

FreshMart Assistant can make mistakes. Please check prices and ingredients before you buy.

Powered byCogitX Cartesian
Poppins
9:41

FreshMart

Delivering to Home · 94107 · in 45 min

🥛Dairy
🥦Produce
🍞Bakery
🥩Meat
🍿Snacks

Lucerne Farms Eggs Large

$1.29

Wilcox Family Farm Organic Brown Eggs

$1.29

O Organics Sharp Cheddar Sliced

$2.99

Horizon Organic String Cheese

$5.99

FreshMart Assistant

What's on your grocery list?

Tell me what you're cooking or who you're feeding. I'll find the products, compare prices, plan meals around your diet and allergies, and fill your cart.

FreshMart Assistant can make mistakes. Please check prices and ingredients before you buy.

Powered byCogitX Cartesian
Lora

Try any of them live in the Playground.

Shape and motion

  • cornerRadius (default 12.dp) is the base radius for cards and inputs. Chips and buttons stay pill-shaped.
  • showOrb (default true) controls the animated agent orb that shows what the assistant is doing: searching, comparing, composing and so on. Set it to false for a calmer UI. The text trace is still shown.