Cover
A banner: its children are drawn over a picture, a gradient or a color.
Use it for: Hero sections and the top of cards. Add a scrim when text sits on a picture.
- CategoryLayout
- ChildrenAny number
- DataNone
- ActionOptional. With an action the whole block can be tapped: go to a route or run an operation
- Row colorCan take its fill from a field of the row (bindings.tint)
| Prop | Required | Accepts | What it does |
|---|---|---|---|
height |
Yes | sm, md, lg, xl |
How tall it is: sm 120, md 200, lg 280, xl 360 points. |
asset |
No | text in a fixed format | Path of an image in the project, for example assets/logo.png. |
alt |
No | text, up to 200 characters | What the image shows, for VoiceOver. |
scrim |
No | none, bottom, full |
Darkens the fill so text on it stays readable: at the bottom, or full. |
contentAlign |
No | top, center, bottom |
Where the children sit: top, center or bottom (the default). |
Every component also accepts id (required, unique on its screen), and the optional preset and style described in Style options. Every component except Screen accepts when, described in Data-driven look.
Example
Section titled “Example”{ "id": "banner", "type": "Cover", "props": { "height": "md", "contentAlign": "bottom" }, "style": { "backgroundColor": "$color.primary", "radius": "$radius.lg" }, "children": [ { "id": "banner-title", "type": "Text", "props": { "text": "This week", "maxLines": 1 }, "style": { "typography": "$typography.headline", "color": "$color.surface" } } ]}