Reference

Elements

Text, button, toggle, input, chart and table in messages: fields, values and sizes.

Open as Markdown

You attach these six elements to a message, in the elements field of POST /v1/push. Up to 12 per message.

Overview

typeElementUsed forValueInteractive
textTextHeading, paragraph, or notethe textno
buttonButtonTrigger an action–yes, on every tap
toggleToggleSwitch something on or offtrue or falseyes, on every flip
inputInputSend text to your toolthe textyes, on submit
chartChartNumbers as bars or a linethe pointsno
tableTableData in rows and columnsthe rowsno

Value is what your tool passes along when sending. For toggles and inputs, it changes when you use them in the app; Packlets stores it. Your tool can no longer change values in a message that has been sent. Interactive means: every interaction goes to your webhook as a ui event with the message_id.

Common fields

FieldTypeRequiredMeaning
typeone of the six typesyesKind of element.
id1 to 40 characters: letters, digits, _, -yesYour identifier, unique per message. Comes back in the webhook as element_id.
widthinteger 1 to 6noWidth in columns. Default 6, the full width.
heightnumber in pointsnoMinimum height. Not for text.

How width and height work together is covered under Layout.

Text

Status of your servers

All good

All services are reachable.

  • api: 120 ms
  • shop: 210 ms

Last checked at 9:41

style: title, body, and caption
FieldTypeRequiredMeaning
texttext, 1 to 2,000 charactersyesThe content.
styletitle, body, or captionnoHeading, paragraph (default), or small gray note.
  • Value: the text.
  • Size: at least 2 columns wide. The height follows the content, there is no height.
  • For body, the same formatting applies as in the message text.
JSON
{ "type": "text", "id": "stand", "text": "Last checked at 9:41", "style": "caption" }

Button

shop-api not responding

Since 9:38 AM, status 502.

style: primary and secondary. With height, the button gets taller.
FieldTypeRequiredMeaning
labeltext, 1 to 40 charactersyesLabel.
styleprimary or secondarynoDark (default) or light.
  • Value: none. A tap sends the ui event with value: null.
  • Size: at least 2 columns wide, height 44 to 240.
  • A button can be tapped any number of times. That sets it apart from the button in the buttons field.
JSON
{ "type": "button", "id": "restart", "label": "Restart", "width": 3 }

Toggle

Maintenance tonight at 10 PM

The shop will be offline for about 10 minutes.

Show maintenance page

Notify customers beforehand

Sends an email at 9 PM to everyone with an open order

With and without description
FieldTypeRequiredMeaning
labeltext, 1 to 60 charactersyesLabel.
descriptiontext, up to 160 charactersnoExplanation below the label.
valuetrue or falsenoInitial value. Default false.
  • Value: true or false. Every flip sends the ui event with the new value.
  • Size: at least 3 columns wide, height 64 to 240.
JSON
{ "type": "toggle", "id": "wartung", "label": "Show maintenance page", "value": true }

Input

New inquiry from Lena K.

Where is my order #1042?

Reply to Lena

Sent
Submitting shows “Sent”
FieldTypeRequiredMeaning
labeltext, 1 to 60 charactersyesLabel.
placeholdertext, up to 80 charactersnoGray example text in the empty field.
buttontext, 1 to 30 charactersnoLabel of the submit button. If omitted, the app shows "Send" or "Senden", depending on the phone's language.
valuetext, up to 500 charactersnoInitial value. Default empty.
  • Value: the text, up to 500 characters. The ui event only arrives on submit, not on every letter.
  • Size: at least 3 columns wide, height 160 to 400.
JSON
{ "type": "input", "id": "antwort", "label": "Reply to Lena", "placeholder": "e.g. Ships today", "button": "Reply" }

Chart

Weekly report

Revenue and response time for the last seven days.

Revenue

640 €
Mon
Tue
Wed
Thu
Fri
Sat
Sun

Response time

128 ms
MonTueWedThuFriSatSun
Bars (default) and line. The highlighted point and its value are at the top right.
FieldTypeRequiredMeaning
labeltext, 1 to 60 charactersyesTitle of the card.
chartbar or linenoBars (default) or line.
unittext, up to 8 charactersnoUnit after the value at the top right.
pointslist, up to 31 pointsnoPer point {"label": "Mon", "value": 3.5}. label up to 12 characters, value a number. Default empty.
highlightinteger from 0noWhich point is highlighted, counted from 0. Default: the last one.
  • Value: the points.
  • Size: at least 3 columns wide, height 120 to 480.
  • With many points, the app shows only every second or third label.
JSON
{
  "type": "chart", "id": "umsatz", "label": "Revenue", "unit": "€",
  "points": [{ "label": "Mon", "value": 860 }, { "label": "Tue", "value": 1204 }]
}

Table

3 new orders

Since 8 AM.

Orders

No.Customer€
1047Jonas M.89.9
1048Aylin S.34.5
1049Tim R.129
Numbers are right-aligned
FieldTypeRequiredMeaning
columnslist, 1 to 6 textsyesColumn headers, each up to 30 characters.
rowslist, up to 50 rowsnoEach row is a list of cells: text (up to 80 characters) or number. At most as many cells as columns. Default empty.
labeltext, up to 60 charactersnoTitle of the card.
  • Value: the rows.
  • Size: at least 3 columns wide, height 80 to 800.
  • An empty table shows "No entries yet". Wide tables can be scrolled sideways.
JSON
{
  "type": "table", "id": "bestellungen", "label": "Orders",
  "columns": ["No.", "Customer", "€"],
  "rows": [["1047", "Jonas M.", 89.9], ["1048", "Aylin S.", 34.5]]
}

Unknown types

Packlets rejects a type that doesn't exist with 400 invalid_body. TypeScript types you can copy are under Ready-made code.