Android · cartesian-ui
Options
CartesianOptions, CartesianFeatures, CartesianTheme, CartesianColors, CartesianStrings and CartesianSlots.
All option classes are immutable. You build them with a Builder, start from DEFAULT, and copy them with toBuilder().
CartesianOptions
| Builder | Type | Default |
|---|---|---|
theme | CartesianTheme | CartesianTheme.DEFAULT |
title | String | "Cartesian" |
starters | List<String> | Vertical defaults |
features | CartesianFeatures | CartesianFeatures.DEFAULT |
slots | CartesianSlots | All built-in |
strings | CartesianStrings | Vertical defaults |
CartesianFeatures
| Builder | Type | Default |
|---|---|---|
cart | FeatureMode (BuiltIn, Host, Off) | BuiltIn |
wishlist | FeatureMode | BuiltIn |
suggestions | SuggestionMode (Off, Starters, StartersAndFollowUps) | StartersAndFollowUps |
suggestionPlacement | SuggestionPlacement (AboveComposer, Inline) | AboveComposer |
feedback | Boolean | true |
newChat | Boolean | true |
trace | Boolean | true |
productTap | Boolean | true |
voice | Boolean | true |
CartesianTheme
| Builder | Type | Default |
|---|---|---|
colors | CartesianColors | See Theme |
fontFamily | FontFamily | Spline Sans |
displayFontFamily | FontFamily | Spline Sans |
emphasisFontFamily | FontFamily | IBM Plex Serif Italic |
cornerRadius | Dp | 12.dp |
showOrb | Boolean | true |
CartesianColors
background, surface, surfaceMuted, line, lineStrong, ink, inkMuted, inkSubtle, inkFaint, accent, primary, onPrimary, sale, success, successSoft and badge, each a Color. The defaults are listed in Theme.
CartesianStrings
heading(before, emphasis = "", after = ""), subtitle, placeholder, disclaimer, cartName, signedOut.
CartesianSlots
One builder method per slot. The full list and their signatures are in Slots and components. The slot type aliases are:
typealias ControllerSlot = @Composable (controller: CartesianChatController) -> Unit
typealias HeaderSlot = @Composable (controller: CartesianChatController, onClose: (() -> Unit)?) -> Unit
typealias ProductSlot = @Composable (product: Product, controller: CartesianChatController) -> Unit
typealias ProductListSlot = @Composable (products: List<Product>, controller: CartesianChatController) -> Unit
typealias UserMessageSlot = @Composable (message: UserMessage, controller: CartesianChatController) -> Unit
typealias AssistantMessageSlot = @Composable (message: AssistantMessage, controller: CartesianChatController) -> Unit
typealias ComparisonSlot = @Composable (comparison: Comparison, controller: CartesianChatController) -> Unit
typealias CartUpdateSlot = @Composable (update: CartUpdate, controller: CartesianChatController) -> Unit
typealias SuggestionsSlot = @Composable (suggestions: List<String>, controller: CartesianChatController) -> Unitkotlin