# Morphing a Floating Action Button into a Dialog in Compose Multiplatform

DevFeed: [Morphing a Floating Action Button into a Dialog in Compose Multiplatform](<https://devfeed.tech/articles/morphing-a-floating-action-button-into-a-dialog-in-compose-multiplatform-96502.md>)

Original publisher: [Read original article](<https://joebirch.co/uncategorized/morphing-a-floating-action-button-into-a-dialog-in-compose-multiplatform/>)

Author: hitherejoe

Published: 2026-10-23T02:06:12Z

Content type: tutorial

Language: en

Sources: [Joe Birch](<https://devfeed.tech/sources/joe-birch.md>)

Topics: [compose-multiplatform](<https://devfeed.tech/topics/compose-multiplatform.md>), [Interaction Design](<https://devfeed.tech/topics/interaction-design.md>), [User interface design](<https://devfeed.tech/topics/ui-design.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [Library](<https://devfeed.tech/topics/library.md>), [callback](<https://devfeed.tech/topics/callback.md>)

Tags: [alert](<https://devfeed.tech/tags/alert.md>), [button](<https://devfeed.tech/tags/button.md>), [compose](<https://devfeed.tech/tags/compose.md>), [compose-multiplatform](<https://devfeed.tech/tags/compose-multiplatform.md>), [dialog](<https://devfeed.tech/tags/dialog.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>)

## AI overview

MorphingFab animates a floating action button into a dialog by treating both as one Surface driven by a single progress value. It interpolates position, size, corner radius, and color, while separate fade thresholds hide the icon early and reveal dialog content late; the content is measured at its final size so text does not reflow during the morph. At rest the FAB stays in the composable tree so other screen touches work. During animation it moves to a full-window Popup overlay with a scrim, then returns to the tree when collapsed. The component receives expanded state from its caller and only reports click or dismissal requests; Android handles system back, while the iOS back handler is currently a no-op. It should be placed at the screen root because it measures its parent to locate the FAB; for Scaffold's floating action button slot, the library provides an anchor-based placement.

## Source excerpt

When a floating action button kicks off an action that requires a paid plan, such as when free users hit their binder limit in Sleevd, we show an alert dialog to prompt the user to upgrade. In most apps, this dialog fades in at the centre of the screen with no connection to the button... Continue reading ->