Known direct subclasses
LayoutStyleScope

An interface that introduces the layout properties to a Style receiver scope.

Known indirect subclasses
StyleScope

A StyleScope is the receiver scope of a Style lambda.


An interface that introduces size properties to a Style receiver scope interface.

See also
StyleScope

Summary

Public functions

Unit
height(fraction: @FloatRange(from = 0.0, to = 1.0) Float)

Sets the height of the component to a fraction of the parent's available height.

Cmn
Unit
height(value: Dp)

Sets the preferred height of the component.

Cmn
Unit
width(fraction: @FloatRange(from = 0.0, to = 1.0) Float)

Sets the width of the component to a fraction of the parent's available width.

Cmn
Unit
width(value: Dp)

Sets the preferred width of the component.

Cmn

Extension functions

Unit

Sets the height of the component to fill the parent's available height (equivalent to height(1.0f)).

Cmn
Unit

Sets the width and height of the component to fill the parent's available space (equivalent to width(1.0f) and height(1.0f)).

Cmn
Unit

Sets the width of the component to fill the parent's available width (equivalent to width(1.0f)).

Cmn
Unit

Sets the preferred width and height of the component to the same value.

Cmn
Unit

Sets the preferred width and height of the component using a DpSize object.

Cmn
Unit

Sets the preferred width and height of the component.

Cmn

Public functions

height

fun height(fraction: @FloatRange(from = 0.0, to = 1.0) Float): Unit

Sets the height of the component to a fraction of the parent's available height. The specified height includes any padding.

This property is not inherited

Parameters
fraction: @FloatRange(from = 0.0, to = 1.0) Float

The fraction of the available height (e.g., 0.5f for 50%).

height

fun height(value: Dp): Unit

Sets the preferred height of the component. The actual size will also depend on the parent's constraints and other modifiers. The specified height includes both contentPadding and externalPadding.

This property is not inherited

Parameters
value: Dp

The preferred height in Dp.

width

fun width(fraction: @FloatRange(from = 0.0, to = 1.0) Float): Unit

Sets the width of the component to a fraction of the parent's available width. The specified width includes any padding.

This property is not inherited

Parameters
fraction: @FloatRange(from = 0.0, to = 1.0) Float

The fraction of the available width (e.g., 0.5f for 50%).

width

fun width(value: Dp): Unit

Sets the preferred width of the component. The actual size will also depend on the parent's constraints and other modifiers. The specified width includes both contentPadding and externalPadding.

This property is not inherited

Parameters
value: Dp

The preferred width in Dp.

Extension functions

SizeScope.fillHeight

@ExperimentalFoundationStyleApi
fun SizeScope.fillHeight(): Unit

Sets the height of the component to fill the parent's available height (equivalent to height(1.0f)). The specified height includes any padding.

This property is not inherited

SizeScope.fillSize

@ExperimentalFoundationStyleApi
fun SizeScope.fillSize(): Unit

Sets the width and height of the component to fill the parent's available space (equivalent to width(1.0f) and height(1.0f)). The specified size includes any padding.

This property is not inherited

SizeScope.fillWidth

@ExperimentalFoundationStyleApi
fun SizeScope.fillWidth(): Unit

Sets the width of the component to fill the parent's available width (equivalent to width(1.0f)). The specified width includes any padding.

This property is not inherited

@ExperimentalFoundationStyleApi
fun SizeScope.size(value: Dp): Unit

Sets the preferred width and height of the component to the same value. The actual size will also depend on the parent's constraints and other modifiers. The specified size includes any padding.

This property is not inherited

Parameters
value: Dp

The preferred width and height in Dp.

See also
size
@ExperimentalFoundationStyleApi
fun SizeScope.size(value: DpSize): Unit

Sets the preferred width and height of the component using a DpSize object. The actual size will also depend on the parent's constraints and other modifiers. The specified size includes any padding.

This property is not inherited

Parameters
value: DpSize

The preferred size.

See also
size
@ExperimentalFoundationStyleApi
fun SizeScope.size(width: Dp, height: Dp): Unit

Sets the preferred width and height of the component. The actual size will also depend on the parent's constraints and other modifiers. The specified dimensions includes both contentPadding and externalPadding.

This property is not inherited

Parameters
width: Dp

The preferred width in Dp.

height: Dp

The preferred height in Dp.

See also
size