---
title: "calculateListDetailPaneScaffoldState"
description: "This function calculates [ThreePaneScaffoldValue] based on the given [PaneScaffoldDirective],
[ThreePaneScaffoldAdaptStrategies], and the current pane destination of a
[ListDetailPaneScaffold]."
type: "composable"
---

<div class='type'>Composable Function</div>


<a id='references'></a>

<div class='sourceset sourceset-android'>Android</div>


```kotlin
@ExperimentalMaterial3AdaptiveApi
@Composable
fun calculateListDetailPaneScaffoldState(
    currentDestination: ThreePaneScaffoldDestinationItem<*> =
        ThreePaneScaffoldDestinationItem(ListDetailPaneScaffoldRole.List, null),
    scaffoldDirective: PaneScaffoldDirective =
        calculateStandardPaneScaffoldDirective(currentWindowAdaptiveInfo()),
    adaptStrategies: ThreePaneScaffoldAdaptStrategies =
        ListDetailPaneScaffoldDefaults.adaptStrategies()
): ThreePaneScaffoldState
```


This function calculates `ThreePaneScaffoldValue` based on the given `PaneScaffoldDirective`,
`ThreePaneScaffoldAdaptStrategies`, and the current pane destination of a
`ListDetailPaneScaffold`.

#### Parameters

| | |
| --- | --- |
| currentDestination | the current destination item, which will be guaranteed to have the      highest priority when deciding pane visibilities. |
| scaffoldDirective | the layout directives that the associated `ListDetailPaneScaffold`      needs to follow. The default value will be the calculation result from      `calculateStandardPaneScaffoldDirective` with the current window configuration, and      will be automatically updated when the window configuration changes. |
| adaptStrategies | the `ThreePaneScaffoldAdaptStrategies` should be used by scaffold panes. |




<div class='sourceset sourceset-android'>Android</div>


```kotlin
@ExperimentalMaterial3AdaptiveApi
@Composable
fun calculateListDetailPaneScaffoldState(
    destinationHistory: List<ThreePaneScaffoldDestinationItem<*>>,
    scaffoldDirective: PaneScaffoldDirective =
        calculateStandardPaneScaffoldDirective(currentWindowAdaptiveInfo()),
    adaptStrategies: ThreePaneScaffoldAdaptStrategies =
        ListDetailPaneScaffoldDefaults.adaptStrategies()
): ThreePaneScaffoldState
```


This function calculates `ThreePaneScaffoldValue` based on the given `PaneScaffoldDirective`,
`ThreePaneScaffoldAdaptStrategies`, and the pane destination history of a
`ListDetailPaneScaffold`.

#### Parameters

| | |
| --- | --- |
| destinationHistory | The history of past destinations items. The last destination will      have the highest priority, and the second last destination will have the second highest      priority, and so forth until all panes have a priority assigned. Note that the last      destination is supposed to be the last item of the provided list. When the history is      empty or there are panes left unassigned, default priorities will be assigned to those      panes in the order of Detail > List > Extra. |
| scaffoldDirective | the layout directives that the associated `ListDetailPaneScaffold`      needs to follow. The default value will be the calculation result from      `calculateStandardPaneScaffoldDirective` with the current window configuration, and      will be automatically updated when the window configuration changes. |
| adaptStrategies | the `ThreePaneScaffoldAdaptStrategies` should be used by scaffold panes. |





