|
| 1 | +import React, { FC } from 'react'; |
| 2 | +import { Accordion, Collapse } from '@rescui/collapse'; |
| 3 | +import { useTextStyles } from '@jetbrains/kotlin-web-site-ui/out/components/typography'; |
| 4 | + |
| 5 | +export const FaqBlock = () => { |
| 6 | + const textCn = useTextStyles(); |
| 7 | + const linkClass = textCn('rs-link', { hardness: 'hard' }); |
| 8 | + |
| 9 | + return ( |
| 10 | + <Accordion> |
| 11 | + <div className={'ktl-layout ktl-layout--center ktl-offset-bottom-xxl'}> |
| 12 | + <div className={'ktl-row'}> |
| 13 | + <div className="ktl-col-12 ktl-col-md-6"> |
| 14 | + <Collapse title={'What is Kotlin Multiplatform?'}> |
| 15 | + Kotlin Multiplatform is a technology that allows you to create applications for various |
| 16 | + platforms and efficiently reuse code across them while retaining the benefits of native |
| 17 | + programming. Your applications will run on iOS, Android, macOS, Windows, Linux, and more. |
| 18 | + </Collapse> |
| 19 | + <Collapse |
| 20 | + title={'What’s the difference between Kotlin Multiplatform and Compose Multiplatform?'} |
| 21 | + > |
| 22 | + Kotlin Multiplatform is the core technology that lets you share code – such as business |
| 23 | + logic, data models, networking, and more – across multiple platforms, including Android, |
| 24 | + iOS, desktop, web, and server. It focuses on code reuse without replacing the native UI |
| 25 | + unless you want it to.{' '} |
| 26 | + <a className={linkClass} href={'https://www.jetbrains.com/compose-multiplatform/'}> |
| 27 | + Compose Multiplatform |
| 28 | + </a>{' '} |
| 29 | + is an optional UI framework built on top of Kotlin Multiplatform. It allows you to share |
| 30 | + your user interface across platforms using a modern, declarative approach similar to Jetpack |
| 31 | + Compose on Android. You can use it to build visually appealing, responsive UIs for Android, |
| 32 | + iOS, desktop, and web from a single codebase. |
| 33 | + </Collapse> |
| 34 | + <Collapse title={'Are Kotlin Multiplatform and Compose Multiplatform ready for production?'}> |
| 35 | + Yes, Kotlin Multiplatform is production-ready for all supported platforms – Android, iOS, |
| 36 | + desktop, web, and server. Compose Multiplatform is stable for Android, iOS, and desktop, |
| 37 | + while the web target is currently in Beta. |
| 38 | + </Collapse> |
| 39 | + </div> |
| 40 | + |
| 41 | + <div className="ktl-col-12 ktl-col-md-6"> |
| 42 | + <Collapse |
| 43 | + title={ |
| 44 | + 'Where should I choose Kotlin Multiplatform (KMP) over other cross-platform solutions?' |
| 45 | + } |
| 46 | + > |
| 47 | + <ul className={textCn('rs-ul')}> |
| 48 | + Choose Kotlin Multiplatform when you need: |
| 49 | + <li> |
| 50 | + <strong>Incremental adoption:</strong> KMP lets you share code selectively – start |
| 51 | + with a single module or expand to your full app at your own pace. |
| 52 | + </li> |
| 53 | + <li> |
| 54 | + <strong>Native performance:</strong> KMP compiles to native code for each platform |
| 55 | + with no bridges or VMs, ensuring high performance and responsiveness. |
| 56 | + </li> |
| 57 | + <li> |
| 58 | + <strong>Truly native UI with Compose Multiplatform:</strong> Compose Multiplatform |
| 59 | + respects each platform's UI conventions, offering a native-feeling experience across |
| 60 | + Android, iOS, desktop, and web. |
| 61 | + </li> |
| 62 | + <li> |
| 63 | + <strong>The same tools and architecture as Kotlin and Jetpack Compose:</strong> Your |
| 64 | + skills will transfer easily, reducing onboarding and ramp-up time. |
| 65 | + </li> |
| 66 | + <li> |
| 67 | + <strong>Direct access to platform APIs:</strong> You can call native APIs directly – |
| 68 | + with no wrappers needed and zero time wasted waiting for framework updates. |
| 69 | + </li> |
| 70 | + <li> |
| 71 | + <strong>Escape hatches for native code:</strong> You can write fully native code |
| 72 | + where needed (e.g. for performance-critical components), without having to abandon |
| 73 | + the cross-platform approach. |
| 74 | + </li> |
| 75 | + </ul> |
| 76 | + Learn more about{' '} |
| 77 | + <a className={linkClass} href="/docs/multiplatform/kotlin-multiplatform-flutter.html"> |
| 78 | + KMP and Flutter |
| 79 | + </a>{' '} |
| 80 | + and{' '} |
| 81 | + <a className={linkClass} href="/docs/multiplatform/kotlin-multiplatform-react-native.html"> |
| 82 | + KMP and React Native |
| 83 | + </a> |
| 84 | + . |
| 85 | + </Collapse> |
| 86 | + |
| 87 | + <Collapse title={'Do I have to rewrite my app to use KMP?'}> |
| 88 | + No. You can start small by sharing a module or feature and integrating it into your existing |
| 89 | + app. KMP is designed for gradual adoption, making it easy to incrementally introduce |
| 90 | + cross-platform code. |
| 91 | + </Collapse> |
| 92 | + </div> |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + </Accordion> |
| 96 | + ); |
| 97 | +}; |
0 commit comments