Package-level declarations

Types

Link copied to clipboard

Material 3 contrast levels (standard, medium, high), for readability needs.

Link copied to clipboard

Built-in color palettes for AiElementsTheme, each a full Material 3 color scheme computed from one seed color by Google's material-color-utilities (tonal-spot; GRAPHITE is the neutral variant), in light and dark and at three contrast levels. Regenerate with tools/generate-schemes.mjs.

Link copied to clipboard
object AiSize

Component sizes from the M3 Expressive icon-button and touch-target specs.

Link copied to clipboard
object AiSpacing

Spacing on the Material 4dp grid. Components use these instead of literals so an app can see (and match) the rhythm the kit is built on.

Link copied to clipboard
object AiType

Reading type for conversation content, derived from the app's MaterialTheme.typography (so custom fonts carry over). Chat is long-form reading on a small screen: body sits between M3 bodyMedium and bodyLarge, the same density as mainstream assistant apps, and headings step down so a reply doesn't read like a document title page.

Properties

Link copied to clipboard
@get:Composable
@get:ReadOnlyComposable
val MaterialTheme.isDark: Boolean

True when the active scheme is dark (works with dynamic color too).

Link copied to clipboard
val LocalCodeFontFamily: ProvidableCompositionLocal<FontFamily>

The font AI Elements uses for code; set through AiElementsTheme.

Functions

Link copied to clipboard
fun aiColorScheme(palette: AiPalette, dark: Boolean, contrast: AiContrast = AiContrast.STANDARD): ColorScheme

The generated scheme for palette; cached, cheap to call from composition.

Link copied to clipboard
@Composable
fun AiElementsTheme(darkTheme: Boolean = isSystemInDarkTheme(), dynamicColor: Boolean = true, palette: AiPalette = AiPalette.VIOLET, contrast: AiContrast = AiContrast.STANDARD, fontFamily: FontFamily? = null, codeFontFamily: FontFamily = FontFamily.Monospace, colorScheme: ColorScheme? = null, typography: Typography? = null, shapes: Shapes = ExpressiveShapes, openLinksInCustomTabs: Boolean = true, content: @Composable () -> Unit)

Material 3 Expressive theme for AI Elements: expressive motion (spring based), rounder shapes, and dynamic color on Android 12+; otherwise (or with dynamicColor off) one of the generated AiPalette schemes.

Link copied to clipboard
fun Modifier.compactIconButton(): Modifier

An extra-small (32dp) icon button that still has a 48dp touch target: the visual shrinks, the hit area doesn't.