Header
Default header layout used by SyntaxHighlightedCode's header slot: the language label on the left, the trailing actions on the right.
Pass to header to retain the default layout while customising individual pieces via languageLabel and actions, or call it directly from a custom header slot:
SyntaxHighlightedCode(
code = snippet,
language = "kotlin",
header = { onCopy ->
SyntaxHighlightedCodeDefaults.Header(
languageLabel = { SyntaxHighlightedCodeDefaults.LanguageLabel("kotlin") },
actions = { copy -> SyntaxHighlightedCodeDefaults.CopyButton(onClick = copy) },
onCopy = onCopy,
padding = PaddingValues(horizontal = 24.dp, vertical = 12.dp),
)
},
)Nothing is rendered when both languageLabel and actions are null.
Parameters
Optional composable rendered on the left side of the row.
Optional trailing actions rendered on the right side of the row, laid out with RowScope. Receives the pre-wired copy action to forward to copy buttons.
Copy action forwarded to actions. Wire this to any copy button's onClick.
Modifier applied to the root Row. Use this for background, test tags, or other positioning/customisation.
Padding applied around the header row. Defaults to headerPadding.