Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🎨 Expressive Compose (expressive-compose)

Material 3 Expressive for Compose Multiplatform & Jetpack Compose with ZERO @OptIn headaches.

expressive-compose is a clean, stable utility & wrapper library that brings Material 3 Expressive UI components, bouncy spring motion tokens, and morphing polygon shapes to Android, Desktop (JVM), iOS, JS, and WasmJs with zero boilerplate and no experimental warning annotations.


🌟 Why expressive-compose?

  1. Zero Opt-In Leakage: You never need to write @OptIn(ExperimentalMaterial3ExpressiveApi::class) or clutter your compiler arguments.
  2. Compose Multiplatform Ready: Shared commonMain code supporting Android, Desktop (JVM), iOS (iosX64, iosArm64, iosSimulatorArm64), JS, and WasmJs.
  3. One-Liner First: Sensible defaults for all shapes, physics, and waves so you get stunning UI with a single line of code.
  4. Resilient Facade: As Material 3 Expressive evolves between Alpha, Beta, and Stable releases, your app's codebase remains intact while the wrapper bridges the changes under the hood.

📦 Modules

ExpressiveComposeUI/
├── expressive-core/          // KMP Motion presets (Bouncy, Snappy) & 12+ Polygon Shapes
├── expressive-components/    // KMP WavySlider, ChunkySlider, FloatingToolbar, SplitButton, Progress
├── expressive-compose/       // KMP Umbrella module (import 1 to get all)
└── sample-catalog/           // Android showcase & interactive playground app

🚀 Quick Start

Add the dependency to your commonMain (or Android module) build.gradle.kts:

// Kotlin Multiplatform (commonMain)
kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation("io.github.namhoangdev31:expressive-compose:0.1.0-alpha01")
        }
    }
}

Or in a single-platform Android module:

dependencies {
    implementation("io.github.namhoangdev31:expressive-compose:0.1.0-alpha01")
}

🛠️ Components & Code Examples

1. Wavy Slider 🌊

Interactive sine-curve wave that dynamically springs when dragged:

var volume by remember { mutableFloatStateOf(0.6f) }

ExpressiveWavySlider(
    value = volume,
    onValueChange = { volume = it }
)

2. Chunky Slider 🎚️

Thick modern track slider inspired by Android 15/16 system UI:

ExpressiveChunkySlider(
    value = brightness,
    onValueChange = { brightness = it }
)

3. Material Shapes & Morphing 🌸

Instant polygon shapes (Scallop, Squircle, Clover, Flower, Sunny, SoftStar):

// Apply shape to any Composable:
Box(
    modifier = Modifier
        .size(64.dp)
        .expressiveShape(ExpressiveShapes.Flower)
        .background(MaterialTheme.colorScheme.primary)
)

// Smooth morphing between two shapes:
Box(
    modifier = Modifier
        .size(64.dp)
        .morphShape(
            start = RoundedPolygon.circle(),
            end = RoundedPolygon.star(numVerticesPerRadius = 8),
            progress = animatedProgress
        )
)

4. Expressive Button & Split Button 🔘

Spring-bouncy touch feedback and split action layouts:

// Bouncy Button
ExpressiveButton(onClick = { /* do action */ }) {
    Text("Bouncy Button")
}

// Split Button
ExpressiveSplitButton(
    leadingButton = {
        FilledTonalButton(onClick = { save() }) { Text("Save") }
    },
    trailingButton = {
        FilledTonalButton(onClick = { showMenu() }) {
            Icon(Icons.Default.ArrowDropDown, contentDescription = null)
        }
    }
)

5. Floating Toolbar 🪄

Floating action toolbar with pill shape:

ExpressiveFloatingToolbar(expanded = isExpanded) {
    IconButton(onClick = {}) { Icon(Icons.Default.Edit, contentDescription = null) }
    IconButton(onClick = {}) { Icon(Icons.Default.Share, contentDescription = null) }
}

6. Wavy Indicators & Loading 🌀

// Wavy linear progress
ExpressiveWavyLinearProgress(progress = { downloadProgress })

// Continuous polygon morph loader
ExpressiveMorphLoader(size = 48.dp)

📱 Running the Sample Catalog

To test and interact with all components on a connected device or emulator:

./gradlew :sample-catalog:installDebug

📄 License

Apache License 2.0.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages