# KMP: A Use Case For Common UI Behavior - Jigar Brahmbhatt

DevFeed: [KMP: A Use Case For Common UI Behavior - Jigar Brahmbhatt](<https://devfeed.tech/articles/kmp-a-use-case-for-common-ui-behavior-jigar-brahmbhatt-38247.md>)

Original publisher: [Read original article](<https://touchlab.co/kmp-a-use-case-for-common-ui-behavior>)

Published: 2023-01-27T19:15:18Z

Content type: tutorial

Language: en

Sources: [Touchlab | Enterprise Mobile Innovation & Development](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [kmp](<https://devfeed.tech/tags/kmp.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [platforms](<https://devfeed.tech/tags/platforms.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

This post describes using Kotlin Multiplatform to share logic for auto-formatting a number field across Android, iOS, and ReactJS. After platform-specific implementations exposed complex cursor-position edge cases and unique bugs, the developers refactored common string-manipulation logic into shared code.

## Source excerpt

This post demonstrates how we used KMP code for a common UI feature across three platforms. Requirement Recently, we got a new feature requirement for the SDK we're developing using Kotlin Multiplatform (KMP). The SDK has a typical UI form with a variety of fields in it that the user fills out. One of the fields is a field. The requirement was to auto-format the number as the user types out.