SizeScope

Known direct subclasses
LayoutStyleScope

This interface is deprecated. This scope type is being removed.

Known indirect subclasses
StyleScope

This interface is deprecated. This scope type is being removed.


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)

This function is deprecated. This scope type is being removed.

Cmn
Unit
height(value: Dp)

This function is deprecated. This scope type is being removed.

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

This function is deprecated. This scope type is being removed.

Cmn
Unit
width(value: Dp)

This function is deprecated. This scope type is being removed.

Cmn

Extension functions

Unit

This function is deprecated. This style property is being removed.

Cmn
Unit

This function is deprecated. This style property is being removed.

Cmn
Unit

This function is deprecated. This style property is being removed.

Cmn
Unit

This function is deprecated. This style property is being removed.

Cmn
Unit

This function is deprecated. This style property is being removed.

Cmn
Unit

This function is deprecated. This style property is being removed.

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