ReferenceComponents

screens

Screens of your app to open from the answer, from the routes you registered.

Where to finish the job. screens offers one to four screens of your own app: the order, the delivery settings, the payment form. Each card names the thing the way the user knows it ("Order #4821") and, under it, the screen's own title as you registered it, so where a tap goes is on the card before it is tapped.

A tap opens the screen through your app's own navigation, and the assistant shrinks into a small bubble in the corner; a tap on the bubble brings the answer back exactly as it was. The first card is also drawn lit beside the microphone.

Order #4821Orders › OrderChange deliveryOrders › Delivery

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

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

Offered only to an app that registers routes (registerRoute in the SDK), and only to a build that carries out a navigate. The model sees the routes, their titles and their params; it never sees the code that opens them.

Registering a route

Flutter:

Rendel.registerRoute(
  'order_detail',
  title: 'Orders › Order',
  description: 'One order: its items, delivery and returns.',
  params: {'order_id': RendelRouteParam.string(required: true, fromActions: true)},
  open: (p) => router.push('/orders/${p['order_id']}'),
);

Web:

Rendel.registerRoute({
  name: 'order_detail',
  title: 'Orders › Order',
  description: 'One order: its items, delivery and returns.',
  params: { order_id: { type: 'string', required: true, fromActions: true } },
  open: (p) => navigate('/orders/' + p.order_id),
});

Names are snake_case, up to 64 characters. A title is 1–60 characters, a description up to 300, and a route takes up to 8 params; an app registers up to 50 routes. A param with fromActions: true must be a value one of your actions returned in this conversation, so a guessed id never opens the screen. Routes ride in the manifest, and both calls are safe before init.

While your screen shows, Rendel waits in a bubble. bubbleOffset keeps it above your own bottom bar (Flutter RendelConfig.bubbleOffset, default 104; web default 104 on a phone-wide page, 24 otherwise). Full signatures: Flutter SDK reference, Web SDK.

What the server checks

Before the block leaves, every navigate in it is checked against your routes: the route has to be one you registered, the params the ones it declares, of their types, the required ones present. A param you mark fromActions has to equal a field one of your actions returned in this conversation, so an order id, an amount or an IBAN the model made up, or read in your knowledge, does not open the screen. A block that fails is shown as its fallback_text.

Props

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

PropTypeRequiredConstraints
itemsarrayYes1 to 4 entries.
items[].titlestringYes1 to 80 characters.
items[].iconstringNoUp to 40 characters.
items[].actionactionYes{ kind: "navigate", route }. See Actions. A navigate to a route you registered. params: up to 8; values are strings up to 200 characters, numbers or booleans, as the route declares.

On the wire

{
  "id": "blk_52",
  "type": "screens",
  "fallback_text": "Open order 4821 in the app.",
  "props": {
    "items": [
      {
        "title": "Order #4821",
        "icon": "package",
        "action": { "kind": "navigate", "route": "order_detail", "params": { "order_id": "4821" } }
      }
    ]
  }
}

Accessibility

Each card is announced by its title and the screen's title. The bubble is a button labelled "Back to the assistant".