StylishCode

fun StylishCode(text: String, modifier: Modifier = Modifier, containerColor: Color = MaterialTheme.colorScheme.surfaceVariant, contentColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, shape: Shape = RectangleShape, textStyle: TextStyle = MaterialTheme.typography.bodySmall.copy( fontFamily = FontFamily.Monospace, ))

A monospaced inline code display — the web "Code" pattern from Chakra UI and Ant Design.

Parameters

text

The code text to display.

modifier

Modifier applied to the root surface.

containerColor

Background of the code block. Defaults to MaterialTheme.colorScheme.surfaceVariant.

contentColor

Foreground of the code text. Defaults to MaterialTheme.colorScheme.onSurfaceVariant.

shape

Corner shape. Defaults to a small rounded rectangle.

textStyle

Typography of the code. Defaults to bodySmall in a monospace family.