ReferenceComponents

offers

The coupons and campaigns a person holds, a ticket each, with a code to copy.

What the user can save, at a glance. offers draws each coupon or campaign as a ticket: what it is worth on the stub, what it is for, when it ends, and its code.

15%offOuterwearOrders over $120Ends SundayRAIN15FreedeliveryExpress deliveryOrders over $80Until 30 NovApplied at checkout

Drawn live in your browser with the SDK’s own sizes and colours, not a screenshot.

Rendered natively by the Flutter SDK since 0.101.0 and the web SDK since 0.76.0. A build that does not declare it is never offered it.

code must be a value one of your actions returned in this conversation, or a code written exactly so, case and all, in the knowledge the answer used or in your Persona instructions. A block carrying a code the app never gave is not drawn; its fallback text is shown instead, so nobody types a code that fails at the till.

When not to use it

One code to show at a counter or a gate, with its QR or barcode, is a pass. A discount already applied to an order belongs on the receipt.

Props

Every block also carries type and a required fallback_text of 1 to 300 characters.

PropTypeRequiredConstraints
titlestringNoUp to 80 characters.
itemsarrayYes1 to 8 entries.
items[].valuestringYes1 to 12 characters.
items[].unitstringNoUp to 16 characters.
items[].titlestringYes1 to 60 characters.
items[].termsstringNoUp to 100 characters.
items[].ends_labelstringNoUp to 30 characters.
items[].ending_soonbooleanNoNone
items[].codestringNo1 to 32 characters.
items[].notestringNoUp to 40 characters.
items[].spent_labelstringNoUp to 30 characters.

On the wire

{
  "id": "blk_92",
  "type": "offers",
  "fallback_text": "Two offers: 15% off outerwear with RAIN15 until Sunday, and free express delivery over $80.",
  "props": {
    "items": [
      {
        "value": "15%",
        "unit": "off",
        "title": "Outerwear",
        "terms": "Orders over $120",
        "ends_label": "Ends Sunday",
        "ending_soon": true,
        "code": "RAIN15"
      },
      {
        "value": "Free",
        "unit": "delivery",
        "title": "Express delivery",
        "terms": "Orders over $80",
        "ends_label": "Until 30 Nov",
        "note": "Applied at checkout"
      }
    ]
  }
}

Interaction

A tap on the code copies it and says Copied for a moment. An offer with a spent_label is struck through and shows that label where its code would be. ending_soon draws the end date as a warning; any other date is said plainly.