Displays
File

typescriptCopied1// First ask the user for a file.2const { photo } = await airplane.prompt({ photo: "upload" });34// Then display it in the UI5await airplane.display.file(photo);
The file to render, as a download link. If the file is a text, csv, image, video, or audio file, it will also be shown inline alongside the download link.
pythonCopied1# First ask the user for a file.2values = airplane.prompt({"photo": airplane.File})34# Then display it in the UI5airplane.display.file(values["photo"]);
The file to render, as a download link. If the file is a text, csv, image, video, or audio file, it will also be shown inline alongside the download link.
If the display could not be created.
JSON

typescriptCopied1await airplane.display.json(httpResponse);
The object to render.
pythonCopied1airplane.display.json(data)
The object to render.
If the display could not be created.
Table

typescriptCopied1await airplane.display.table(users);
The list of rows to render in the table. Each row should be an object mapping header slugs to values. Columns that are not specified will default to None
. The selection, ordering, and naming of columns can be customized via opts.columns.
Declares the list of columns to include in the table. The order of columns in this list determines the order of columns when rendering the table. Each column can optionally specify a human-readable name that will be used when rendering the table. The name defaults to the slug
. Columns found in rows
that are not included in columns
will not be rendered.
If not specified, columns are inferred automatically from the provided rows:
- The set of columns is the union of all keys across all rows.
- The column order is inferred from the key order of the first row. All other columns not present in the first row are ordered after.
- Columns are named by their
slug
.
pythonCopied1airplane.display.table(users)
The list of rows to render in the table. Each row should be an object mapping header slugs to values. Columns that are not specified will default to None
. The selection, ordering, and naming of columns can be customized via columns.
The list of columns to include in the table. The order of columns in this list determines the order of columns when rendering the table. Each column can optionally specify a human-readable name that will be used when rendering the table. The name defaults to the slug
. Columns found in rows
that are not included in columns
will not be rendered.
If not specified, columns are inferred automatically from the provided rows:
- The set of columns is the union of all keys across all rows.
- The column order is inferred from the key order of the first row. All other columns not present in the first row are ordered after.
- Columns are named by their
slug
.
If the ID token could not be created.
If columns have empty or duplicate slugs.
Override column names
rows
. These can be overridden with
opts.columns
.
typescriptCopied1await airplane.display.table(users, {2columns: [3{ name: "Username", slug: "name" },4{ name: "Email", slug: "email" },5],6});
pythonCopied1airplane.display.table(2users,3columns=[4airplane.TableColumn(slug="name", name="Username"),5airplane.TableColumn(slug="email", name="Email"),6]7)
Text

typescriptCopied1await airplane.display.text(`Found **${users.length}** users from team "${team.name}".`);
The markdown-formatted content to render. See the CommonMark docs for an introduction to markdown formatting.
pythonCopied1airplane.display.text(f"Found **{len(users)}** users from team {name}.")
The markdown-formatted content to render. See the CommonMark docs for an introduction to markdown formatting.
If the display could not be created.