rememberCollapsedTopAppBarState

Creates and remembers a TopAppBarState that starts in a collapsed position.

This helper waits until Material 3 calculates TopAppBarState.heightOffsetLimit, then applies that limit as the current TopAppBarState.heightOffset exactly once.

It is intended for usage such as: val state = rememberCollapsedTopAppBarState() and val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(state).

Return

A remembered TopAppBarState initialized to the collapsed offset.