npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@momo-kits/native-kits

v0.157.11

Published

ComposeKit là bộ UI Kit đa nền tảng phục vụ Mini App/SDK của MoMo. Toàn bộ giao diện, điều hướng, token thiết kế và layer tích hợp với MaxAPI đều được viết bằng Kotlin Multiplatform để tái sử dụng cho Android, iOS (qua Compose Multiplatform) cũng như các

Downloads

6,691

Readme

ComposeKit (Kotlin Multiplatform)

ComposeKit là bộ UI Kit đa nền tảng phục vụ Mini App/SDK của MoMo. Toàn bộ giao diện, điều hướng, token thiết kế và layer tích hợp với MaxAPI đều được viết bằng Kotlin Multiplatform để tái sử dụng cho Android, iOS (qua Compose Multiplatform) cũng như các host native.

Mục tiêu & phạm vi

  • Chuẩn hoá visual language của MoMo với kho component Compose đã mang sẵn màu sắc, typography, spacing, radius trong vn.momo.compose.kit.const.
  • Cung cấp navigation stack thống nhất (NavigationContainer, Navigator, bottom tabs, modal/bottom sheet) hỗ trợ dynamic screen registry và MaxAPI dismiss/present.
  • Cho phép host nhận context Mini App (MiniAppContext, KitConfig, ApplicationContext, AppLanguage) để tự động render Trust Banner, header assets, tracking.
  • Đồng bộ hoá với native SwiftUI kit (nativeSDK/ios) nhằm cover các màn đang viết Swift/Objective‑C.

Cấu trúc thư mục

  • shared/: module KMP chính. Chứa toàn bộ source vn.momo.compose.kit.*, compose resources (font SF Pro), logic publish Maven và podspec.
  • composeApp/: sample Compose Multiplatform Android dùng để thử nhanh component, navigator, trust banner.
  • iosApp/: project SwiftUI + CocoaPods để test framework iOS sinh ra từ shared.
  • nativeSDK/ios/: Swift package + podspec MoMoUIKits (phụ thuộc SDWebImageSwiftUI, SkeletonUI) cho các màn hoàn toàn native.
  • publish_release.sh, .gitlab-ci.yml: script tự bump patch version, chạy :compose:publish... khi commit có [ci build].
  • build-output/, build/: output tạm thời (không commit).

Thành phần chính trong shared

Design tokens & theming

  • const/Colors.kt, Radius.kt, Spacing.kt, Typography.kt định nghĩa token thống nhất.
  • const/Theme.kt cung cấp Theme, ColorScheme, AppTheme, AppThemeController. Có sẵn defaultTheme & darkTheme, hỗ trợ inject assets (vd. header background từ KitConfig).

Layout primitives & modifier

  • layout/Card.kt, Section.kt, Item.kt chứa khung section theo guideline Super App.
  • modifier/AutomationId, Conditional, Shadow, Size giúp thêm accessibility id, điều kiện hoá modifier, shadow blur tuỳ nền.

UI components

  • Buttons (Button.kt, IconButton.kt), typography helper (Text.kt, Title.kt), badge/tag (Badge*, Tag.kt), chip & switch (Chip.kt, Switch.kt), checkbox/radio.
  • Input stack: Input* (OTP, PhoneNumber, Money, Search, DropDown, TextArea) với keyboard helpers.
  • Pagination indicator (PaginationDot/Number/Scroll/WhiteDot.kt), skeleton loading (Skeleton.kt), trust UI (TrustBanner.kt).
  • Popup/notify (PopupNotify, PopupPromotion), floating button, LazyColumnWithBouncing, Cupertino overscroll, DateTimePicker (Wheel UI + utils).
  • Lottie animation (components/animation/LottieAnimation) dựng trên Compottie để chạy animation JSON đồng nhất trên Android/iOS/Desktop.

Navigation & application layer

  • navigation/NavigationContainer, Navigation.kt, Navigator.kt, StackScreen.kt, BottomSheet.kt, bottom tab helpers.
  • Navigator hỗ trợ push, replace, present, reset, pop(count), showModal, showBottomSheet với overlay registry (OverplayComponentRegistry).
  • application/NavigationContainer.kt, MiniAppContext, KitConfig, ApplicationContext, AppConfig, AppLanguage cung cấp context cho header/trust banner, mapping sang map để gửi qua MaxAPI.
  • application/Screen.kt, Header*, Footer, FloatingButton tạo template screen (đang deprecate, khuyến nghị dùng NavigationContainer + StackScreen).

Platform utilities

  • platform/Platform.kt định nghĩa expect/actual cho getPlatformName, BackHandler, getScreenHeight, NativePaint mask filter. Android actual đi kèm getAndroidBuildVersion.
  • utils/Icons.kt, Resources.kt, getAppStatusBarHeight() giúp truy xuất resource Compose đa nền tảng.

Native bridge

  • shared/shared.podspecnativeSDK/ios/MoMoUIKits.podspec cho phép embed vào iOS app via CocoaPods (deployment target 15.0, Swift 5). Phần native duy trì các SwiftUI component tương đương Compose (Button, Input, Popup, Trust Banner, Badge...).

Yêu cầu môi trường

  • JDK 17+, Gradle 8, Android Studio Hedgehog+ với Android SDK (compileSdk xem libs.versions.toml).
  • Kotlin Multiplatform plugin + Compose Multiplatform (JetBrains 1.6.1+).
  • Xcode 15, CocoaPods 1.12+ để build iosApp hoặc publish Pod.
  • Truy cập mạng nội bộ GitLab Packages nếu cần publish/consume Maven repo https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven.

Build & kiểm thử nhanh

| Tác vụ | Lệnh | | --- | --- | | Build thư viện KMP (AAR + klib + framework) | ./gradlew :compose:assembleRelease | | Publish local maven (nếu cần thử) | ./gradlew :compose:publishAllPublicationsToMavenLocal | | Sample Android | ./gradlew :composeApp:assembleDebug | | Sample iOS | mở iosApp/iosApp.xcworkspace rồi build trên Xcode |

Output Compose nằm trong shared/build/outputsshared/build/publications/*. Debug fonts/resources ở shared/src/commonMain/composeResources.


Publish nội bộ (GitLab Packages)

  1. Cập nhật gradle.properties nếu thay đổi group/artifact/version. Mặc định:
    name=ComposeKit
    group=vn.momo.kits
    artifact.id=kits
    version=0.1.2
    url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
    gitlab.user=upload_packages
    gitlab.password=<token>
  2. Chạy ./publish_release.sh. Script sẽ:
    • Đọc version hiện tại, query các version đã publish qua GitLab API.
    • Bump patch (X.Y.Z+1) đến khi không trùng.
    • Ghi lại gradle.properties, export VERSION, chạy ./gradlew clean + :compose:publishAllPublicationsToGitLabPackagesRepository.
  3. CI (.gitlab-ci.yml) tự động thực thi script này khi push với commit message chứa [ci build] (trừ khi branch khớp engine/w*).

Tích hợp ComposeKit trong dự án KMP/Android

Thêm dependency

repositories {
    maven { url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven") }
}

commonMain.dependencies {
    implementation("vn.momo.kits:kits:<version>")
}

Khởi tạo navigation container

val miniAppContext = MiniAppContext(appId = "...", appCode = "...", appIcon = "...", toolkitConfig = ...)

NavigationContainer(
    initialScreen = { StackScreenExample() },
    options = NavigationOptions(headerTitle = HeaderTitle.Default("Home")),
    applicationContext = miniAppContext,
    config = KitConfig(trustBanner = defaultBanner),
    maxApi = maxApi, // IMaxApi implementation từ host
    setNavigator = { navigator = it }
)

Bên trong screen, truy cập LocalNavigator.current để:

val navigator = LocalNavigator.current
navigator.push { DetailScreen() }
navigator.showBottomSheet(content = { BottomSheetContent() })

Tuỳ biến theme bằng AppThemeController:

val themeController = AppThemeController.current
themeController(defaultTheme.copy(colors = defaultTheme.colors.copy(primary = Colors.pink_04)))

ApplicationContext.current, AppConfig.current, AppLanguage.current giúp component (ví dụ TrustBanner) tự lấy dữ liệu trust banner và tracking service_component_clicked.


Tích hợp iOS / Native SDK

  • shared/shared.podspec sinh framework Compose (static) mang tên theo artifact.id (kits). Add vào Podfile:
    pod 'kits', :path => '../shared'
  • Với màn SwiftUI thuần native, dùng nativeSDK/ios:
    pod 'MoMoUIKits', :path => 'nativeSDK/ios'
    Bộ này mirror hầu hết component Compose (Button, Input, Popup, TrustBanner...). ApplicationEnvironment chấp nhận MiniAppContext, KitConfig tương tự Kotlin.

Lưu ý khác

  • Screen composable cũ được đánh dấu @Deprecated; sử dụng NavigationContainer + StackScreen để hưởng lợi dynamic route và animation.
  • DesignSystemWhiteList trong application/ApplicationContainer.kt hỗ trợ fallback cho host cũ; đừng kích hoạt nếu không cần.
  • Khi thêm tài nguyên mới, đặt trong shared/src/commonMain/composeResources để Compose Multiplatform plugin sinh accessor tự động.
  • Repo không bundle SDK bên thứ ba ngoại trừ vn.momo.corex.maxapi, Compose/Coil/Ktor và Compottie cho animation.

Animation Lottie đa nền tảng với Compottie

import io.github.alexzhirkevich.compottie.LottieCompositionSpec
import vn.momo.kits.components.animation.LottieAnimation

@Composable
fun SuccessState() {
    LottieAnimation(
        spec = LottieCompositionSpec.Url(
            "https://assets10.lottiefiles.com/packages/lf20_jcikwtux.json"
        )
    )
}
  • shared/build.gradle.kts đã bật coreLibraryDesugaringEnabled để tương thích compottie-dot/compottie-network với minSdk = 24.
  • Nếu animation dùng asset/font nội bộ, kết hợp compottie-resources (rememberResourcesAssetsManager, rememberResourcesFontManager) để trỏ về composeResources.