# toon-ui

> A Compose Multiplatform UI kit in the look of golden-age theatrical cartoons: ink outlines, cel fills, hard shadows, squash and dust, on Android, iOS, desktop and wasm.

Page: https://kotlin.website/toon-ui

## Why it exists

Material decides how a press feels and how a surface ends, and a skin over it inherits both. This
kit draws its own: all 27 components of the design, and four of the library's besides — a list of
cards, a screen-transition host, a pull-to-refresh box that pulls its content, and the stage the
rest stand on.

## Held to the design twice, then allowed to leave it

Each component started from the design and is checked twice over: its geometry, frame by frame,
against the design's own drawing engine run in Node, and its pixels against references rendered from
the design in Chrome.

The code is primary, though. Where the running kit showed something the design gets wrong — a seam
under the tooltip's tail, a stripe across the menu's rolls, half the slider's rope standing still in
a drag — the component departs from it. Each departure is listed with its reason, and the checks skip
exactly the listed cells, so everything else is still the design's.

## Motion you can test

Curves are functions of elapsed time, ported from the design's engine, not `spring()` calls. A test
reads them at the design's own timestamps, and motion the design does not draw is tested at every
millisecond for a jump, with a mutant that brings the jump back to prove the test can see it.

Reduce motion follows the design's word for each animation — a fade, a static spinner, or nothing —
rather than switching everything off.

## Install

```kotlin
repositories {
    maven("https://reposilite.kotlin.website/snapshots") {
        mavenContent { includeGroupAndSubgroups("io.github.youndie") }
    }
}

dependencies {
    implementation("io.github.youndie:toon-core:0.1.0.<build>")
}
```

Every build of `main` publishes a version, and the latest is the last one in
[maven-metadata.xml](https://reposilite.kotlin.website/snapshots/io/github/youndie/toon-core/maven-metadata.xml).
There is no release yet.

```kotlin
ToonTheme(ToonThemes.InkGouacheLight) {
    ToonStage {
        ToonFxHost {
            ToonButton("Add plan", onClick = {})
        }
    }
}
```

`ToonStage` paints the theme's backdrop and texture; `ToonFxHost` draws the dust, stars and speed
lines the components fire. Targets: desktop (JVM), Android, iOS and wasm.
