New:
-
Support Kotlin 1.9.20 via JetBrains Compose compiler 1.5.3.
-
@MosaicComposable
annotation restricts composable function usage to those meant for Mosaic
(e.g., ourText
) or general-purpose (e.g., Compose'sremember
). In most cases the Compose
compiler can infer this automatically, but it's available for explicit use if needed. -
LocalTerminal
composition local provides the size of the terminal if it can be detected.
If the size changes, your function will automatically be recomposed with the new values.val size = LocalTerminal.current.size Text("Terminal(w=${size.width}, h=${size.height})")
-
Row
,Column
, andBox
now support horizontal and vertical alignment of their children.Column { Text("This is very long") Text( "On the right", modifier = Modifier.align(End), ) }
-
Add
AnnotatedString
withSpanStyle
for string customization. Instead of writing a series of
Text
functions in aRow
, emit a singleText
with formatting changes within the string.Text(buildAnnotatedString { append("Plain! ") withStyle(SpanStyle(color = BrightGreen)) { append("Green! ") } withStyle(SpanStyle(color = BrightBlue)) { append("Blue!") } })
-
Spacer
node for occupying space within layouts. -
Constraints and intrinsics are now available in the layout system.
This version works with Kotlin 1.9.20 by default.