> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encorekit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sheet Appearance

> Give the reward sheet your fonts, colors, corners, and images per component with AppearanceConfig.sheet in the Android SDK.

The reward sheet is drawn from a variant that Encore serves, so its layout can change between experiments while your code stays the same. `AppearanceConfig.sheet` styles the parts of that sheet, such as the title, the offer rows, the close button, and the main button, with your fonts, colors, corners, and images. You style a part by its component name, so one style holds for every variant that draws that part.

> [!NOTE]
>
> New in Android SDK 2.6.0.

## Style the sheet from code

Pass a `SheetAppearance` as `sheet` in the `AppearanceConfig` you give the placement (`fun appearance(config: AppearanceConfig): PlacementBuilder`). Every field is optional. With no `sheet` value, and no style from the Style editor, the sheet draws the variant as Encore designed it.

```kotlin theme={null}
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontLoadingStrategy
import androidx.compose.ui.unit.dp
import com.encorekit.encore.*

val sheet = SheetAppearance(
    headingFontFamily = FontFamily(Font(R.font.oswald_semibold, loadingStrategy = FontLoadingStrategy.OptionalLocal)), // a font your app bundles
    components = mapOf(
        SheetComponent.Title to SheetComponentStyle(font = SheetFontRole.HEADING),
        SheetComponent.PrimaryButton to SheetComponentStyle(
            fill = SheetColor("#F5C52B"), cornerRadius = 999.dp, borderWidth = 2.dp,
            borderColor = SheetColor("#3A2A00"), contentColor = SheetColor("#2A1E00"), font = SheetFontRole.HEADING,
        ),
        SheetComponent.OfferRowSelected to SheetComponentStyle(fill = SheetColor("#FFF3DC"), borderColor = SheetColor("#E9A33A")),
        SheetComponent("header") to SheetComponentStyle(
            fill = SheetColor("#F7D04A"),
            backgroundImage = "https://cdn.example.com/stars.png",
        ),
    ),
)

// Inside a coroutine:
val result = Encore.placement("streak_day_7")
    .useCase(UseCase.REWARD_USERS)
    .appearance(AppearanceConfig(accentColor = "#F5C52B", sheet = sheet))
    .show()
```

The `appearance` option is in the [placement reference](https://docs.encorekit.com/publishers/android/sdk-reference/placement.md#appearance), and every `SheetAppearance` field is in the [SheetAppearance reference](https://docs.encorekit.com/publishers/android/sdk-reference/placement.md#sheetappearance).

The trigger fields of `AppearanceConfig`, such as `fontFamily`, `cornerRadius`, `borderWidth`, `borderColor`, `backgroundImage`, and `iconImage`, style trigger components only. They never reach the sheet, so setting them leaves the sheet as it was.

## Fonts

`SheetAppearance` takes two fonts, both optional:

* `headingFontFamily`: for the text of every component whose style sets the heading role (`font: heading`). Your code or the Style editor can set that role.
* `bodyFontFamily`: for every other text on the sheet, including text that is not in a styled component.

A role you leave unset draws the system font.

Each is a font your app already has, never a download. Pass a Compose `FontFamily`, for example `FontFamily(Font(R.font.my_display, loadingStrategy = FontLoadingStrategy.OptionalLocal))`. Use `FontLoadingStrategy.OptionalLocal` for every `Font`: the default `Blocking` strategy crashes the app when a font can't load, and `OptionalLocal` falls back to the system font. Build each `FontFamily` once and pass the same instance every time: the SDK compares fonts by identity, so a new instance restyles the sheet. Fonts come from your code only: when the Style editor is on for your app, it shows which text is heading and which is body, and points to this page to set the families.

The variant keeps its own text sizes and weights; only the face changes. A font with a single face draws that face at every weight, with no synthetic bold.

## Component styles

Each entry in `components` names a component and gives it a `SheetComponentStyle`. Every property is optional, and each one applies by the kind of element the variant draws for that component. A property that does not apply to that element, or a value out of range, is skipped with a warning in the SDK log.

```kotlin theme={null}
data class SheetComponentStyle(
    val fill: SheetColor? = null,          // SheetColor(hex) or SheetColor(light, dark): background of a box, button or text, or a shape's fill
    val cornerRadius: Dp? = null,          // 0 to 999 (999 draws a capsule)
    val borderWidth: Dp? = null,           // 0 to 8
    val borderColor: SheetColor? = null,
    val contentColor: SheetColor? = null,  // the text and icons in the component
    val font: SheetFontRole? = null,       // HEADING or BODY
    val image: String? = null,             // URL: replaces a picture or an icon (a button keeps its spoken label)
    val trueImage: String? = null,         // URL: replaces the on state of a toggle-like part, such as the selection check
    val falseImage: String? = null,        // URL: replaces its off state
    val backgroundImage: String? = null,   // URL: covers the box behind the content, cropped at the edges
    val animation: SheetAnimation? = null, // a Lottie file in place of the picture or icon
    val enter: SheetEnter? = null,         // an entrance, played once
    val loop: SheetLoop? = null,           // a repeating animation
)
```

Colors are hex: `#RRGGBB`, or `#RRGGBBAA` for transparency. `SheetColor("#FFFFFF")` applies in light and dark mode; `SheetColor(light = "#FFFFFF", dark = "#1C1C1E")` sets each mode. Image URLs must be HTTPS. A `closeButton` content color must be opaque, so the close mark always shows. An image on an icon button, such as `closeButton`, draws fit in a box up to 48 points wide and 20 points tall, centred across the icon with its bottom on the icon's bottom, and takes no layout space, so the sheet does not move. Upload it at up to 144 by 60 pixels. A 2:1 image draws 40 by 20 points, and a square draws 20 by 20 points (60 by 60 pixels). The button's tap target grows to at least 44 by 44. An image that replaces any other icon draws at that icon's size.

## Component names

A variant tags the parts of the sheet with these names. Each name except `header` has a constant on `SheetComponent`, such as `SheetComponent.OfferRow`. Any other name works as `SheetComponent("name")`, for example `SheetComponent("header")`, including a name Encore adds later, with no SDK update. A name that no element in the variant carries does nothing.

| Component | What it is |
| - | - |
| `sheetBackground` | The full-bleed canvas behind the sheet |
| `header` | The top bar of a screen: the title, the subtitle, and the close button together |
| `closeButton` | The icon-only dismiss control |
| `title` | The headline of a screen |
| `subtitle` | The line directly under a title |
| `footnote` | Small print outside the offers, such as the trial line |
| `footer` | The bottom bar that holds the main button |
| `offerRow` | One offer in a vertical list: logo, name, and perk |
| `offerRowSelected` | The selected state of an offer row |
| `offerCard` | One offer in a carousel or a grid |
| `selectionIndicator` | The radio or check on a row or card |
| `offerLogo` | The advertiser logo (app code only: corner and border; the logo image is not editable) |
| `offerTitle` | The advertiser name (not editable) |
| `offerDetail` | The perk and description lines under the name (not editable) |
| `badge` | A pill on an offer, such as "Most claimed" (app code only) |
| `pageIndicator` | Carousel dots |
| `filterChip` | A category chip in the other-gifts panel or a tab bar |
| `panel` | The other-gifts drawer that slides over the list |
| `primaryButton` | The main filled button, such as claim or continue |
| `secondaryButton` | An outlined or quiet button, such as "No thanks" |
| `linkButton` | A text-only button, such as "Show more gifts" |
| `stepList` | The container of the numbered instruction steps |
| `stepMarker` | The numbered circle of an upcoming step |
| `stepMarkerCurrent` | The numbered circle of the current step |
| `stepTitle` | A step's title |
| `stepDetail` | A step's subtitle |
| `summaryCard` | The card on the thank-you screen with the chosen offer |
| `statusIcon` | The icon at the top of a confirmation |
| `giftBox` | The layered gift box art |
| `giftBoxImage` | The gift box art as one picture, which an image or a Lottie animation can replace (in the portal preview only; served variants draw the layered `giftBox` for now) |
| `heroImage` | The sheet's hero picture (app code only) |

`badge`, `heroImage`, and `offerLogo` are not in the Style editor in the publisher portal. App code can still style them: the SDK applies a style to any component name a variant carries.

The Style editor lists `footnote`, `statusIcon`, `offerCard`, `pageIndicator`, `filterChip`, `panel`, and `giftBox` under **Others**, because the default preview does not draw them. Selecting one shows the preview's optional parts. Each takes only what the SDK draws on it today: `offerCard` and `giftBox` take the box (fill, corner radius, border), `pageIndicator` takes the box and the dot color, and `panel` takes the box, text color, and font. `filterChip` takes its corner radius, border, and font, and `statusIcon` takes its icon color. `footnote` takes text color and font. The selected chip has no style of its own yet.

The advertiser's own content is not editable. Neither app code nor the Style editor can style `offerTitle` or `offerDetail`, or replace the `offerLogo` image; app code can still set the logo's corner radius and border. The SDK ignores anything else on them with a warning. Your body font still reaches their text.

## Precedence

A value set in the Style editor in the publisher portal wins over your app code, when the editor is on for your app. Encore turns the editor on for an app on request. It wins per property, so a publisher can restyle the sheet without shipping a build. Your app code applies to each property the Style editor leaves unset, and the variant's own value applies when neither sets it. For example, if the Style editor sets `primaryButton.fill` and your code sets `primaryButton.fill` and `primaryButton.contentColor`, the button takes the editor's fill and your content color. `image` and `animation` count as one slot: if the Style editor sets either one, the editor's choice wins both, so an editor image is never hidden behind an app animation.

## Motion

Entrances, loops, and transitions between the sheet's screens come from Encore's variants. You need no code for them: the SDK plays them, and shows their still pose when the device asks for reduced motion. To add motion to one component from code, set its style's `animation` (a Lottie file in place of a picture), `enter` (an entrance played once), or `loop` (a repeating animation that replaces the variant's loop).

```kotlin theme={null}
val components = mapOf(
    // animation: a Lottie file in place of the gift box picture, with a still for when it cannot play. No served variant carries giftBoxImage yet, so this shows in the Style editor preview only for now
    SheetComponent.GiftBoxImage to SheetComponentStyle(animation = SheetAnimation(
        url = "https://cdn.example.com/gift-open.4f1c9a2e.json",
        fallbackImage = "https://cdn.example.com/gift-open.4f1c9a2e.png",
        loop = false,
    )),
    // enter: the title grows in from 80% and transparent, once, over 0.4 seconds
    SheetComponent.Title to SheetComponentStyle(enter = SheetEnter(from = SheetPose(scale = 0.8, opacity = 0.0), duration = 0.4)),
    // loop: the main button rocks 2 degrees each way, every 3 seconds
    SheetComponent.PrimaryButton to SheetComponentStyle(loop = SheetLoop(duration = 3.0, keyframes = listOf(
        SheetKeyframe(at = 0.0, pose = SheetPose(rotation = -2.0)),
        SheetKeyframe(at = 0.5, pose = SheetPose(rotation = 2.0)),
        SheetKeyframe(at = 1.0, pose = SheetPose(rotation = -2.0)),
    ))),
)
```

The limits of each motion field are in the [SheetAppearance reference](https://docs.encorekit.com/publishers/android/sdk-reference/placement.md#sheetappearance).

## Lottie animations

A variant can play a Lottie animation over a part of the sheet. Lottie is optional: without it, the variant's still image shows in its place. It also shows when the device asks for reduced motion, or when an animation file fails to load.

Add `com.airbnb.android:lottie` 5.2 or later to your app. The Encore SDK does not add it.

## Related

* [Reward Placements](https://docs.encorekit.com/publishers/guides/reward-placements.md): present the reward sheet this page styles.
* [Placement reference](https://docs.encorekit.com/publishers/android/sdk-reference/placement.md#appearance): the appearance option on a presentation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.