# Tips & Interactive Tours (crow-guide) (https://crow.build/docs/stack/guide)

`crow-guide` brings Apple TipKit-style contextual education and multi-step interactive onboarding tours directly into Crow's overlay and routing layers — with **zero `PopupWindow` hacks**.

## Contextual Tips with Rules [#contextual-tips-with-rules]

Define tips declaratively with priority and display rules (`maxDisplays`, event counts, custom predicates):

```kotlin
object AppTips {
    val FilterHint = Tip(
        id = "brews.filter.hint",
        priority = 10,
        rules = tipRules { maxDisplays(3) },
    )
}
```

Manage tip state with `TipCenter` (backed by `FileTipStore` or `InMemoryTipStore`) and provide it via `LocalTipCenter(tipCenter) { ... }`.

## Multi-Step Tours Across Typed Routes [#multi-step-tours-across-typed-routes]

Declare a `tour` where each step specifies a target ID, spotlight cutout shape (`RoundedRect`, `Circle`), popover placement, and the typed `crow-router` route it lives on:

```kotlin
val introTour = tour("app.intro") {
    step(
        id = "filter-bar",
        title = "Filter Conversations",
        body = "Switch between All, Pinned, and Unread threads instantaneously.",
        shape = SpotlightShape.RoundedRect,
        side = PopupSide.Below,
        route = Routes.Feed,
    )
    step(
        id = "composer-bar",
        title = "Quick Composer",
        body = "Draft replies with live attachments and instant optimistic delivery.",
        shape = SpotlightShape.RoundedRect,
        side = PopupSide.Below,
        route = Routes.Compose,
    )
}
```

Tag any UI node anywhere in your app with `Modifier.tourTarget(controller, "filter-bar")`:

- **Morphing `SpotlightScrim`**: As the user taps *Next*, the spotlight cutout smoothly morphs its position and corner radius from the previous target to the next.
- **Cross-route navigation**: When the next step lives on another tab or screen, `TourController` navigates there automatically via `crow-router` and scrolls off-screen targets into view.
- **Anchored glass balloons**: `BalloonBase` keeps its arrow pointing accurately at the target even when shifted near screen edges or while scrolling.
- **Headless testable**: Drive and verify every tour step deterministically in `crow-ui-test`.