Package-level declarations

Types

Link copied to clipboard
data class AlignmentModifier(val horizontal: HorizontalAlignment? = null, val vertical: VerticalAlignment? = null) : Modifier.Element

An element that defines the alignment of a component within its parent.

Link copied to clipboard
data class BackgroundModifier(val color: Color) : Modifier.Element

An element that sets the background color.

Link copied to clipboard

An element that applies bold styling.

Link copied to clipboard
data class BorderModifier(val style: BorderStyle, val color: Color = Color.Default) : Modifier.Element

An element that adds a border around a component.

Link copied to clipboard
data class BorderStyle(val topLeft: Char, val topRight: Char, val bottomLeft: Char, val bottomRight: Char, val horizontal: Char, val vertical: Char)

Defines the characters used to draw borders around UI components.

Link copied to clipboard
sealed class Color

Represents a color that can be used for foreground or background styling in a terminal.

Link copied to clipboard
data class FillMaxHeightModifier(val fraction: Float = 1.0f) : Modifier.Element

An element that requests a fraction of the available height.

Link copied to clipboard
data class FillMaxWidthModifier(val fraction: Float = 1.0f) : Modifier.Element

An element that requests a fraction of the available width.

Link copied to clipboard
data class ForegroundModifier(val color: Color) : Modifier.Element

An element that sets the foreground (text) color.

Link copied to clipboard
data class HeightModifier(val height: Int) : Modifier.Element

An element that constrains the height of a UI component.

Link copied to clipboard

Possible horizontal alignment options.

Link copied to clipboard

An element that applies italic styling.

Link copied to clipboard
data class MarginModifier(val left: Int = 0, val right: Int = 0, val top: Int = 0, val bottom: Int = 0) : Modifier.Element

An element that adds margin outside the boundary of a UI component.

Link copied to clipboard
interface Modifier

An ordered, immutable collection of elements that decorate or augment a UI component.

Link copied to clipboard
data class OffsetModifier(val x: Int = 0, val y: Int = 0) : Modifier.Element

An element that applies a relative offset to a UI component.

Link copied to clipboard
data class PaddingModifier(val left: Int = 0, val right: Int = 0, val top: Int = 0, val bottom: Int = 0) : Modifier.Element

An element that adds padding around the content of a UI component.

Link copied to clipboard

An element that applies strikethrough styling.

Link copied to clipboard

An element that applies underline styling.

Link copied to clipboard

Possible vertical alignment options.

Link copied to clipboard
data class WeightModifier(val weight: Float) : Modifier.Element

An element used in layout containers to distribute remaining space proportionally.

Link copied to clipboard
data class WidthModifier(val width: Int) : Modifier.Element

An element that constrains the width of a UI component.

Link copied to clipboard

An element that signals the component should fit its content vertically.

Link copied to clipboard

An element that signals the component should fit its content horizontally.

Functions

Link copied to clipboard

Sets the horizontal alignment.

Sets the vertical alignment.

Sets both horizontal and vertical alignment.

Link copied to clipboard

Sets the background color.

Link copied to clipboard

Applies bold styling.

Link copied to clipboard
fun Modifier.border(style: BorderStyle, color: Color = Color.Default): Modifier

Adds a border with the specified style and color.

Link copied to clipboard
fun Modifier.fillMaxHeight(fraction: Float = 1.0f): Modifier

Requests to fill the available height, optionally by a fraction.

Link copied to clipboard
fun Modifier.fillMaxSize(fraction: Float = 1.0f): Modifier

Requests to fill all available space, optionally by a fraction.

Link copied to clipboard
fun Modifier.fillMaxWidth(fraction: Float = 1.0f): Modifier

Requests to fill the available width, optionally by a fraction.

Link copied to clipboard

Finds the last element of type T in the modifier chain.

Link copied to clipboard

Flattens the recursive Modifier chain into a linear list of elements.

Link copied to clipboard

Sets the foreground color.

Link copied to clipboard
fun Modifier.height(height: Int): Modifier

Constrains the height to a fixed height.

Link copied to clipboard

Applies italic styling.

Link copied to clipboard
fun Modifier.margin(all: Int): Modifier

Adds all characters of margin on all sides.

fun Modifier.margin(horizontal: Int = 0, vertical: Int = 0): Modifier

Adds horizontal and vertical margin.

fun Modifier.margin(left: Int = 0, right: Int = 0, top: Int = 0, bottom: Int = 0): Modifier

Adds margin for each side individually.

Link copied to clipboard
fun Modifier.offset(x: Int = 0, y: Int = 0): Modifier

Applies a relative x and y offset.

Link copied to clipboard
fun Modifier.padding(all: Int): Modifier

Adds all characters of padding on all sides.

fun Modifier.padding(horizontal: Int = 0, vertical: Int = 0): Modifier

Adds horizontal and vertical padding.

fun Modifier.padding(left: Int = 0, right: Int = 0, top: Int = 0, bottom: Int = 0): Modifier

Adds padding for each side individually.

Link copied to clipboard

Applies strikethrough styling.

Link copied to clipboard

Accumulates all MarginModifier elements in the chain into a single result.

Link copied to clipboard

Accumulates all OffsetModifier elements in the chain into a single result.

Link copied to clipboard

Accumulates all PaddingModifier elements in the chain into a single result.

Link copied to clipboard

Applies underline styling.

Link copied to clipboard
fun Modifier.weight(weight: Float): Modifier

Assigns a relative weight for layout distribution.

Link copied to clipboard
fun Modifier.width(width: Int): Modifier

Constrains the width to a fixed width.

Link copied to clipboard

Sets vertical sizing to fit content.

Link copied to clipboard

Sets both horizontal and vertical sizing to fit content.

Link copied to clipboard

Sets horizontal sizing to fit content.