---
title: "SizeScope"
description: "An interface that introduces size properties to a Style receiver scope interface."
type: "interface"
lastmod: "2026-05-20T01:13:53.383604Z"
---
## API Reference

> Source set: Common

```kotlin
@ExperimentalFoundationStyleApi
interface SizeScope
```

An interface that introduces size properties to a [Style](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Style) receiver scope interface.

## Functions

### width

```kotlin
fun width(value: Dp)
```

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](/jetpack-compose/androidx.compose.foundation/foundation/functions/contentPadding) and
[externalPadding](/jetpack-compose/androidx.compose.foundation/foundation/functions/externalPadding).

This property is *not* inherited

#### Parameters

| | |
| --- | --- |
| value | The preferred width in Dp. |

### height

```kotlin
fun height(value: Dp)
```

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](/jetpack-compose/androidx.compose.foundation/foundation/functions/contentPadding) and
[externalPadding](/jetpack-compose/androidx.compose.foundation/foundation/functions/externalPadding).

This property is *not* inherited

#### Parameters

| | |
| --- | --- |
| value | The preferred height in Dp. |

### width

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

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 | The fraction of the available width (e.g., 0.5f for 50%). |

### height

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

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 | The fraction of the available height (e.g., 0.5f for 50%). |
