Package-level declarations

Types

Link copied to clipboard
@Stable
fun interface Alignment

An interface to calculate the position of a sized box inside an available space. Alignment is often used to define the alignment of a layout inside a parent layout.

Link copied to clipboard
@Immutable
object Arrangement

Used to specify the arrangement of the layout's children in layouts like Row or Column in the main axis direction (horizontal and vertical, respectively).

Link copied to clipboard
@Immutable
class BiasAlignment(val horizontalBias: Float, val verticalBias: Float) : Alignment

An Alignment specified by bias: for example, a bias of -1 represents alignment to the start/top, a bias of 0 will represent centering, and a bias of 1 will represent end/bottom. Any value can be specified to obtain an alignment. Inside the -1, 1 range, the obtained alignment will position the aligned size fully inside the available space, while outside the range it will the aligned size will be positioned partially or completely outside.

Link copied to clipboard
@Immutable
interface BoxScope

A BoxScope provides a scope for the children of Box.

Link copied to clipboard
@Immutable
value class Color
Link copied to clipboard
@Immutable
interface ColumnScope

Scope for the children of Column.

Link copied to clipboard
@Stable
class ImageBitmap(val width: Int, val height: Int, val pixels: IntArray)

An image of width by height pixels, with the colors of its pixels as 0xAARRGGBB, row by row from the top left. The pixels must not change once the bitmap is shown.

Link copied to clipboard
annotation class LayoutScopeMarker
Link copied to clipboard
interface LazyListScope

Receives the items of a LazyColumn.

Link copied to clipboard
@Stable
class LazyListState(firstVisibleItemIndex: Int = 0, firstVisibleItemScrollOffset: Int = 0)

The scroll position of a LazyColumn.

Link copied to clipboard

An annotation that can be used to mark an composable function as being expected to be use in a composable function that is also marked or inferred to be marked as a MosaicComposable.

Link copied to clipboard
@Immutable
interface RowScope

Scope for the children of Row.

Link copied to clipboard
@Immutable
class SpinnerStyle(val frames: List<String>, val interval: Duration)

The frames of a Spinner, each shown for interval before the next.

Link copied to clipboard
@Stable
class TextFieldState(initialText: String = "")

The editable text of a TextField, the position of its cursor, and its selection.

Link copied to clipboard

How Text shows text which does not fit.

Link copied to clipboard
@Immutable
value class TextStyle
Link copied to clipboard
@Immutable
value class UnderlineStyle

Properties

Link copied to clipboard

The width of a ProgressBar whose modifier does not size it.

Link copied to clipboard

true when this is TextStyle.Empty.

Link copied to clipboard

false when this is TextStyle.Empty.

Link copied to clipboard

false when this is Color.Unspecified.

Link copied to clipboard
Link copied to clipboard

true when this is Color.Unspecified.

Link copied to clipboard

Functions

Link copied to clipboard
@Composable
fun Box(modifier: Modifier = Modifier)

A box with no content that can participate in layout, drawing due to the modifier applied to it.

@Composable
fun Box(modifier: Modifier = Modifier, contentAlignment: Alignment = Alignment.TopStart, propagateMinConstraints: Boolean = false, content: @Composable BoxScope.() -> Unit)
Link copied to clipboard
@Stable
fun Color(red: Float, green: Float, blue: Float): Color
@Stable
fun Color(red: Int, green: Int, blue: Int): Color

Creates a new Color instance from an RGB color components.

Link copied to clipboard
@Composable
fun Column(modifier: Modifier = Modifier, verticalArrangement: Arrangement.Vertical = Arrangement.Top, horizontalAlignment: Alignment.Horizontal = Alignment.Start, content: @Composable ColumnScope.() -> Unit)
Link copied to clipboard
@Composable
fun Filler(char: Char, modifier: Modifier = Modifier, foreground: Color = Color.Unspecified, background: Color = Color.Unspecified, textStyle: TextStyle = TextStyle.Unspecified)
@Composable
fun Filler(codePoint: Int, modifier: Modifier = Modifier, foreground: Color = Color.Unspecified, background: Color = Color.Unspecified, textStyle: TextStyle = TextStyle.Unspecified)

Component that represents an layout of identical characters, whose size can be defined using Modifier.width, Modifier.height and Modifier.size modifiers.

Link copied to clipboard
@Composable
fun Image(bitmap: ImageBitmap, modifier: Modifier = Modifier, contentDescription: String? = null)

Shows bitmap, scaled to fit the incoming constraints while keeping its aspect ratio, and at most as large as its pixels on the terminal when its cell size is known.

Link copied to clipboard
inline fun <T> LazyListScope.items(items: List<T>, noinline key: (item: T) -> Any? = null, crossinline itemContent: @Composable (item: T) -> Unit)

Adds an item for each of items.

Link copied to clipboard
inline fun <T> LazyListScope.itemsIndexed(items: List<T>, noinline key: (index: Int, item: T) -> Any? = null, crossinline itemContent: @Composable (index: Int, item: T) -> Unit)

Adds an item for each of items, passing its index as well.

Link copied to clipboard
@Composable
fun Layout(content: @Composable () -> Unit, modifier: Modifier = Modifier, debugInfo: () -> String = { "Layout()" }, measurePolicy: MeasurePolicy)
Link copied to clipboard
@Composable
fun LazyColumn(modifier: Modifier = Modifier, state: LazyListState = rememberLazyListState(), content: LazyListScope.() -> Unit)

A column which only composes and lays out the items which are visible, so that it can hold more items than would be practical to compose at once, like the messages of a long conversation. Content outside of its bounds is clipped.

Link copied to clipboard
@Composable
fun Popup(alignment: Alignment = Alignment.TopStart, offset: IntOffset = IntOffset.Zero, content: @Composable () -> Unit)

Shows content on top of everything else, like a completion menu or a dialog.

Link copied to clipboard
@Composable
fun ProgressBar(progress: Float, modifier: Modifier = Modifier, color: Color = Color.Unspecified, trackColor: Color = Color.Unspecified)

A bar which fills from the left as progress goes from 0 to 1, to an eighth of a cell.

Link copied to clipboard
@Composable
fun rememberLazyListState(firstVisibleItemIndex: Int = 0, firstVisibleItemScrollOffset: Int = 0): LazyListState
Link copied to clipboard
@Composable
fun Row(modifier: Modifier = Modifier, horizontalArrangement: Arrangement.Horizontal = Arrangement.Start, verticalAlignment: Alignment.Vertical = Alignment.Top, content: @Composable RowScope.() -> Unit)
Link copied to clipboard
@Composable
fun Spacer(modifier: Modifier = Modifier)

Component that represents an empty space layout, whose size can be defined using Modifier.width, Modifier.height and Modifier.size modifiers.

Link copied to clipboard
@Composable
fun Spinner(modifier: Modifier = Modifier, style: SpinnerStyle = SpinnerStyle.Dots, color: Color = Color.Unspecified, textStyle: TextStyle = TextStyle.Unspecified)

An animation which shows the frames of style in turn for as long as it is composed, for work whose progress is unknown. It is as wide as the widest frame, so that what follows it stays put.

Link copied to clipboard
inline fun Color.takeOrElse(block: () -> Color): Color

If this color isSpecifiedColor then this is returned, otherwise block is executed and its result is returned.

inline fun TextStyle.takeOrElse(block: () -> TextStyle): TextStyle

If this text style isSpecifiedTextStyle then this is returned, otherwise block is executed and its result is returned.

If this text style isSpecifiedUnderlineStyle then this is returned, otherwise block is executed and its result is returned.

Link copied to clipboard
@Composable
fun Text(value: String, modifier: Modifier = Modifier, color: Color = Color.Unspecified, background: Color = Color.Unspecified, textStyle: TextStyle = TextStyle.Unspecified, underlineStyle: UnderlineStyle = UnderlineStyle.Unspecified, underlineColor: Color = Color.Unspecified, softWrap: Boolean = true, maxLines: Int = Int.MAX_VALUE, overflow: TextOverflow = TextOverflow.Clip)

Displays value.

@Composable
fun Text(value: AnnotatedString, modifier: Modifier = Modifier, color: Color = Color.Unspecified, background: Color = Color.Unspecified, textStyle: TextStyle = TextStyle.Unspecified, underlineStyle: UnderlineStyle = UnderlineStyle.Unspecified, underlineColor: Color = Color.Unspecified, softWrap: Boolean = true, maxLines: Int = Int.MAX_VALUE, overflow: TextOverflow = TextOverflow.Clip)

Displays value with its styles.

Link copied to clipboard
@Composable
fun TextField(state: TextFieldState, modifier: Modifier = Modifier, singleLine: Boolean = false, maxLines: Int = Int.MAX_VALUE, minLines: Int = 1, placeholder: String = "", color: Color = Color.Unspecified, placeholderColor: Color = Color.Unspecified, textStyle: TextStyle = TextStyle.Unspecified, onSubmit: (text: String) -> Unit? = null)

An editable text field.