Components
Components
The catalog: every element a card's ui can contain.
A card's ui is a tree of elements. Each element is a JSON object with a type from this catalog, that type's properties, and for containers a children list. Nothing outside the catalog is accepted: no HTML, styles or scripts.
The same catalog is available as data at GET https://app.hookboard.dev/api/v1/catalog and as JSON Schema inside the OpenAPI document.
All components
| Component | Category | Children | What it is |
|---|---|---|---|
stack | Layout | any | Lays children out in a column or a row. |
grid | Layout | any | Places children in equal columns. Collapses to fewer columns on narrow screens. |
section | Layout | any | A titled group of content. |
panel | Layout | any | A bordered container that sets content apart inside a card. |
tabs | Layout | only tab | Switches between tab panels. Children must be tab elements. |
tab | Layout | any | One panel inside tabs. Only inside tabs. |
accordion | Layout | only accordionItem | Collapsible sections. Children must be accordionItem elements. |
accordionItem | Layout | any | One collapsible section inside an accordion. Only inside accordion. |
scroll | Layout | any | A fixed-height area that scrolls its content. |
separator | Layout | none | A dividing line. |
spacer | Layout | none | Empty space. In a row it pushes siblings apart. |
heading | Content | none | A heading. |
text | Content | none | A run of plain text. |
markdown | Content | none | Formatted text written in Markdown. Raw HTML is not rendered. |
badge | Content | none | A small status label. |
icon | Content | none | An icon from the built-in set. |
alert | Content | none | A callout for something the reader should notice. |
link | Content | none | A link that opens in a new tab. |
code | Content | none | A block of preformatted code or log output, with a copy button. |
time | Content | none | A point in time, kept current while the card is on screen. |
stat | Data | none | One figure with a label and an optional change indicator. |
progress | Data | none | A progress bar. |
meter | Data | none | A ring gauge for a value within a range. |
keyValue | Data | none | A list of label and value pairs. |
table | Data | none | A table of rows. |
list | Data | none | A simple list of items, each with a title and optional details. |
image | Media | none | An image from a URL, or a file sent with the card as {{files.name}}. |
avatar | Media | none | A round picture with a text fallback. |
video | Media | none | A video player. |
audio | Media | none | An audio player. |
button | Input | none | Runs an action when pressed. |
input | Input | none | A single-line text field. |
textarea | Input | none | A multi-line text field. |
select | Input | none | Pick one from a dropdown. |
radio | Input | none | Pick one from a visible list. |
segmented | Input | none | Pick one from a compact row of buttons. |
checkbox | Input | none | A checkbox with a label. |
switch | Input | none | An on/off switch with a label. |
slider | Input | none | Pick a number by dragging. |
lineChart | Chart | none | A line chart over a list of rows. |
areaChart | Chart | none | A filled area chart over a list of rows. |
barChart | Chart | none | A bar chart over a list of rows. |
pieChart | Chart | none | A donut chart showing parts of a whole. |
sparkline | Chart | none | A tiny trend line without axes, for use beside a figure. |
Common properties
These work on every component.
| Property | Type | Required | Default | What it does |
|---|---|---|---|---|
id | text | Optional name for the element, for your own reference. | ||
visibleWhen | expression | Expression; the element is shown only while it is true. | ||
repeat | any JSON | Renders the element once per item: { "each": "data.items", "as": "item" }. Inside, use item and index. | ||
span | number | Columns this element covers inside a grid. | ||
grow | boolean | Take up the free space inside a row. |