Skip to content

ienground/compose-hig

Repository files navigation

Maven Central Main Workflow

Compose-HIG

A modern, highly customizable Compose Multiplatform library implementing Apple's Human Interface Guidelines (HIG) with Liquid Glass visuals, native haptic feedback dynamics, and smooth spring physics.

Forked and expanded from alexzhirkevich/compose-cupertino and slanos/compose-cupertino.


🌟 Key Features

  • iOS 26 HIG Liquid Glass Aesthetic: Advanced backdrop rendering with interactive lens refraction, chromatic aberration, vibrancy, and dynamic luminance tinting.
  • Enhanced Component Suite:
    • πŸ’§ Liquid Glass Components: CupertinoLiquidButton, CupertinoLiquidAlertDialog
    • πŸŽ›οΈ Segmented Control: CupertinoSegmentedControl with spring drag animations, dynamic indicator width, and haptic feedback.
    • πŸ‘† SwipeBox: CupertinoSwipeBox with DSL action builders (start & end), full-swipe auto-trigger, and spring response.
    • πŸ“‹ Grouped Sections & Lazy Lists: CupertinoSection, LazyListScope.section, and stickySection with iOS grouped inset styling.
    • πŸ“… Pickers: CupertinoPicker, CupertinoDatePicker, CupertinoTimePicker, and CupertinoDateTimePicker.
    • 🧭 Navigation & Structure: CupertinoTopAppBar, CupertinoNavigationBar, CupertinoBottomSheet, CupertinoBottomSheetScaffold, CupertinoScaffold.
    • πŸ”˜ Inputs & Switches: CupertinoSwitch, CupertinoCheckbox, CupertinoTextField, CupertinoSearchTextField.
    • 🎨 Standalone Cupertino Icons: Lightweight vector CupertinoIcons (Outlined & Filled) removing unnecessary dependencies on heavy icon packs.

🎬 Preview Video

ScreenRecording_07-20-2026.23-02-34_1.MP4

⚠️ Note: There is a known flickering issue in the iOS sample app.


πŸš€ Live Demo

Try the WasmJS interactive web showcase deployed via GitHub Pages:
πŸ‘‰ https://ienground.github.io/compose-hig/


πŸ“¦ Installation

This package is published to Maven Central Repository.

Declare the dependency in libs.versions.toml:

[versions]
hig = "1.3.0"

[libraries]
hig = { group = "zone.ien.hig", name = "hig", version.ref = "hig" }
hig-adaptive = { group = "zone.ien.hig", name = "hig-adaptive", version.ref = "hig" }
hig-native = { group = "zone.ien.hig", name = "hig-native", version.ref = "hig" }

In build.gradle.kts:

kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation(libs.hig)
            // Optional adaptive / native extensions
            implementation(libs.hig.adaptive)
        }
    }
}

πŸ’‘ Quick Code Examples

1. Liquid Glass Button

val backdrop = rememberDefaultBackdrop()

CupertinoLiquidButton(
    onClick = { /* handle action */ },
    backdrop = backdrop,
) {
    Text("Liquid Glass Button")
}

2. Segmented Control

var selectedIndex by remember { mutableStateOf(0) }

CupertinoSegmentedControl(
    selectedTabIndex = selectedIndex,
) {
    CupertinoSegmentedControlTab(
        isSelected = selectedIndex == 0,
        onClick = { selectedIndex = 0 }
    ) {
        Text("First")
    }
    CupertinoSegmentedControlTab(
        isSelected = selectedIndex == 1,
        onClick = { selectedIndex = 1 }
    ) {
        Text("Second")
    }
}

3. SwipeBox for List Items

CupertinoSwipeBox(
    actionItemBuilder = {
        end {
            CupertinoSwipeBoxItem(
                color = CupertinoColors.systemRed,
                icon = CupertinoIcons.Default.Trash,
                label = "Delete",
                onClick = { /* handle delete */ }
            )
        }
    }
) {
    Text("Swipe left to reveal actions", modifier = Modifier.padding(16.dp))
}

4. Lazy List Section

LazyColumn {
    section(
        title = { Text("SECTION HEADER") },
        caption = { Text("Section description footer text.") }
    ) {
        item {
            Text("Row Item 1", modifier = Modifier.padding(16.dp))
        }
        item {
            Text("Row Item 2", modifier = Modifier.padding(16.dp))
        }
    }
}

πŸ“ To-do

Compared to the previous library, we have made efforts to update many components from the Human Interface Guidelines to match the latest design, but there is still work in progress. Please help complete the library with your contributions!

  • BottomBar
  • Search Bar
  • Dropdown Native
  • Dialog (Non-native)
  • Segmented Control

πŸ“„ License

Copyright (c) 2023-2024. Compose Cupertino project and open source contributors.
Copyright (c) 2025. Scott Lanoue.
Copyright (c) 2026. IENGROUND of IENLAB.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

🀝 Contributions

Contributions are welcome! Please ensure copyright headers are included when submitting Pull Requests.

About

Compose Multiplatform library for using Apple Human Interface Guideline components

Resources

License

Stars

9 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages