<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/kmp-a-use-case-for-common-ui-behavior-duqxl09wl" -->

---
title: KMP: A Use Case For Common UI Behavior | daily.dev
description: A practical case study on using Kotlin Multiplatform (KMP) shared code for UI behavior across Android, iOS, and Web. The team initially implemented phone...
canonical: https://daily.dev/posts/kmp-a-use-case-for-common-ui-behavior-duqxl09wl
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: KMP: A Use Case For Common UI Behavior | daily.dev
og:description: A practical case study on using Kotlin Multiplatform (KMP) shared code for UI behavior across Android, iOS, and Web. The team initially implemented phone...
og:url: https://daily.dev/posts/kmp-a-use-case-for-common-ui-behavior-duqxl09wl
og:image: https://api.daily.dev/og/posts/dUQXl09wl.png
og:image:alt: KMP: A Use Case For Common UI Behavior
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# KMP: A Use Case For Common UI Behavior

**[Touchlab](https://daily.dev/sources/touchlab)** · 4 min read · 0 upvotes · 0 comments

## Summary

A practical case study on using Kotlin Multiplatform (KMP) shared code for UI behavior across Android, iOS, and Web. The team initially implemented phone number auto-formatting separately on each platform, leading to divergent edge case bugs around cursor positioning. By refactoring the core string manipulation and cursor logic into common KMP code, they unified the behavior, simplified platform-specific implementations to thin wrappers, and gained the ability to write comprehensive unit tests for the shared logic.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://touchlab.co/kmp-a-use-case-for-common-ui-behavior>

## Similar posts on daily.dev

- [Why we love multiplatform with Kotlin and Compose](https://daily.dev/posts/why-we-love-multiplatform-with-kotlin-and-compose-ygw5twyaa) · Q42 Engineering · 0 upvotes · 0 comments
- [Helping Decision-Makers Say Yes to Kotlin Multiplatform \(KMP\)](https://daily.dev/posts/helping-decision-makers-say-yes-to-kotlin-multiplatform-kmp--ts09b63zw) · JetBrains · 1 upvotes · 0 comments
- [Why We Chose KMP Over React Native: It’s an Architecture Bet, Not a Framework Preference](https://daily.dev/posts/why-we-chose-kmp-over-react-native-it-s-an-architecture-bet-not-a-framework-preference-gjuzubyyt) · Medium · 1 upvotes · 0 comments
- [Design a screen, get a Clean Architecture feature — Spec-Driven Development that keeps AI-generated KMP code from drifting](https://daily.dev/posts/design-a-screen-get-a-clean-architecture-feature-spec-driven-development-that-keeps-ai-generated--yzrvjusns) · ProAndroidDev · 1 upvotes · 0 comments
- [Kotlin Multiplatform Is Not Cross-Platform: Understanding the Real Difference](https://daily.dev/posts/kotlin-multiplatform-is-not-cross-platform-understanding-the-real-difference-feksv6re1) · Medium · 0 upvotes · 0 comments

---

Tags: [#mobile](https://daily.dev/tags/mobile), [#kotlin](https://daily.dev/tags/kotlin)

[View this post on daily.dev](https://daily.dev/posts/kmp-a-use-case-for-common-ui-behavior-duqxl09wl)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"KMP: A Use Case For Common UI Behavior","url":"https://daily.dev/posts/kmp-a-use-case-for-common-ui-behavior-duqxl09wl","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/kmp-a-use-case-for-common-ui-behavior-duqxl09wl"},"datePublished":"2026-08-02T07:15:22.559Z","dateModified":"2026-08-02T07:37:48.038Z","description":"A practical case study on using Kotlin Multiplatform (KMP) shared code for UI behavior across Android, iOS, and Web. The team initially implemented phone...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/326b6724a52b415908f61dc9ee6ce7ed?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/326b6724a52b415908f61dc9ee6ce7ed?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Touchlab","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Touchlab","logo":"https://media.daily.dev/image/upload/s--CQ0u6GwB--/f_auto,q_auto/v1785654902/logos/touchlab?_a=BAMAMicg0","url":"https://daily.dev/sources/touchlab"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/kmp-a-use-case-for-common-ui-behavior-duqxl09wl","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"mobile,kotlin","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Touchlab","item":"https://daily.dev/sources/touchlab"},{"@type":"ListItem","position":3,"name":"KMP: A Use Case For Common UI Behavior"}]}
```

