A cell defined as a card. You should use a cell-card
when the information you want to display is short and simple, but want the user to tap on it for more information. For example, a cell with basic contact information can be tapped for the full profile. In another example, a cell can show a recipe name and an image, which when tapped shows the full recipe instructions.
Cell cards consist of a three-slot system, with different cell variations offering different slot combinations. For more information, see the demo and the specific child keys listed.
Consider the following situations:
compound-card
, any on-click
defined is ignored.selection-of
, these cards are tappable with an intent automatically generated, even if you do not provide one. Also, if you have multi-selection enabled, on-click
is ignored.list-of
or displaying the details in a result view, and you do not provide an on-click
, then the component won't look nor be tappable.result-view {
match: Flower (flower) {
from-output: ShowFlowerCellCards
}
message {
template ("Here are flowers as cell cards:")
}
render {
if (size(flower) > 1) {
list-of (flower) {
where-each (item) {
cell-card {
slot1 {
image {
url ("#{value(item.imageUrls[0])}")
shape (Square)
}
}
slot2 {
content {
order (PrimarySecondary)
primary ("#{value(item.name)}")
secondary ("#{value(item.priceRange)}")
}
}
on-click {
view-for (item)
}
}
}
}
} else-if (size(flower) == 1) {
layout-match (flower) {
mode (Details)
}
}
}
conversation-drivers {
conversation-driver ("Show a cell area")
}
}
You can run the sample capsule in the Simulator to see how this component displays on different devices, if supported.
This component is applicable during these Moments:
Notice that the background color of each cell card is a different color than the main background color, indicating to the user that the cell card is tappable.
You can find design specifications for this component in the Components Spec download under Design Resources.