Compose library for creating interactive presentations
Find a file
2025-06-09 10:13:42 +02:00
.fleet Init commit 2024-02-03 23:00:34 +01:00
compre Add forgotten file after little refactoring 2025-06-09 10:13:42 +02:00
gradle Update Compose and Koin versions in libs.versions.toml 2025-06-09 10:11:51 +02:00
sample/composeApp Refactor resource imports to use Compose Multiplatform standards 2025-05-06 10:46:40 +02:00
.gitignore Init commit 2024-02-03 23:00:34 +01:00
build.gradle.kts Update dependencies and add Compose Compiler plugin 2025-05-06 09:48:40 +02:00
gradle.properties Update dependencies and add Compose Compiler plugin 2025-05-06 09:48:40 +02:00
gradlew Add publishing to Forgejo git server repo & update Gradle to 8.7 2024-04-18 10:44:53 +02:00
gradlew.bat Init commit 2024-02-03 23:00:34 +01:00
LICENSE.md Add license text 2024-04-19 11:23:22 +02:00
README.md Refactor resource imports to use Compose Multiplatform standards 2025-05-06 10:46:40 +02:00
settings.gradle.kts Add publishing to Forgejo git server repo & update Gradle to 8.7 2024-04-18 10:44:53 +02:00

COMpose-PREsentation

A library for creating interactive presentations in Compose.

Setup

Add to settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        maven("https://joker.morwud.cz/api/packages/Morwud/maven")
    }
}

And then to build.gradle.kts of the compose application:

// ...
kotlin {
    // ...
    sourceSets {
        // ...

        commonMain.dependencies {
            // ...
            implementation("org.zimmma.compose:compre:1.0-SNAPSHOT")
        }
        // ...
    }
}
// ...

The library is still in heavy development, although the bases shouldn't change much.

Usage

In Main.kt:

fun main() {
    application {
        val state = PresentationState()

        val modifier = Modifier

        state.addChapters(
            listOf(
                ChapterImpl(
                    chapterName = "Basics",
                    pages =
                        listOf(
                            StandardContentPage(
                                "Sectioning the page",
                                listOf(
                                    Section(IntRange(1, 4)) { Text("This will be here the whole time [1-4]") },
                                    Section(2) { Text("This will be here only on section [2]") },
                                    Section(IntRange(3, 4)) {
                                        Text("This will be here from now [3] to the end [4]")
                                    },
                                    Section(4) {
                                        Column {
                                            Text("This works for images too")
                                            Image(
                                                painterResource(Res.drawable.kotlin),
                                                contentDescription = null,
                                                modifier =
                                                    modifier
                                                        .padding(end = Paddings.big)
                                                        .clip(RoundedCornerShape(32.dp))
                                                        .size(256.dp)
                                            )
                                            Text("You can end the presentation by pressing 'Q'")
                                        }
                                    }
                                )
                            )
                        )
                )
            )
        )

        Window(
            onCloseRequest = ::exitApplication,
            title = "Test presentation",
            state = rememberWindowState(WindowPlacement.Fullscreen),
            onPreviewKeyEvent = state::HandleKeyEvent
        ) {
            Presentation(config = PresentationConfig(headerImageResourcePath = "images/kotlin.svg"))
        }
    }
}

For more comprehensive example see the sample.