Skip to Content
Hookboard
Components

Layout components

Every layout component a card can use, with its properties and an example.

Each component is an object with a type and the properties listed for it. Text and number properties may also hold a {{ }} template or a { "$bind": "…" } object; see Data, state and bindings. Every component also accepts the common properties.

stack

Lays children out in a column or a row.

Holds other elements in children.

PropertyTypeRequiredDefaultWhat it does
direction"column" "row""column"Which way children flow.
gap"none" "xs" "sm" "md" "lg" "xl""md"Space between children.
align"start" "center" "end" "stretch" "baseline"Cross-axis alignment.
justify"start" "center" "end" "between"Main-axis distribution.
wrapbooleanLet a row wrap onto more lines.
{
  "type": "stack",
  "gap": "md",
  "children": []
}

grid

Places children in equal columns. Collapses to fewer columns on narrow screens.

Holds other elements in children.

PropertyTypeRequiredDefaultWhat it does
columnsnumber2Number of columns, 1 to 6.
gap"none" "xs" "sm" "md" "lg" "xl""md"Space between cells.
align"start" "center" "end"Where a child shorter than its row sits in its cell: at the top (start), the middle or the bottom. Top when left out.
{
  "type": "grid",
  "columns": 2,
  "children": []
}

section

A titled group of content.

Holds other elements in children.

PropertyTypeRequiredDefaultWhat it does
titletextHeading.
descriptiontextSupporting line under the heading.
{
  "type": "section",
  "title": "Section",
  "children": []
}

panel

A bordered container that sets content apart inside a card.

Holds other elements in children.

PropertyTypeRequiredDefaultWhat it does
tone"default" "muted" "primary" "success" "warning" "danger""default"Background tint.
padding"none" "sm" "md" "lg""md"Inner spacing.
{
  "type": "panel",
  "children": []
}

tabs

Switches between tab panels. Children must be tab elements.

Its children must all be tab elements.

PropertyTypeRequiredDefaultWhat it does
bindstate pathState path holding the open tab's value. Optional.
defaultValuetextValue of the tab open at first.
{
  "type": "tabs",
  "children": [
    {
      "type": "tab",
      "label": "First",
      "value": "first",
      "children": []
    },
    {
      "type": "tab",
      "label": "Second",
      "value": "second",
      "children": []
    }
  ]
}

tab

One panel inside tabs.

Only valid directly inside tabs.

Holds other elements in children.

PropertyTypeRequiredDefaultWhat it does
labeltextyesTab label.
valuetextIdentifier for this tab. Defaults to the label.

accordion

Collapsible sections. Children must be accordionItem elements.

Its children must all be accordionItem elements.

PropertyTypeRequiredDefaultWhat it does
multiplebooleanAllow several sections open at once.
{
  "type": "accordion",
  "children": [
    {
      "type": "accordionItem",
      "title": "Details",
      "children": []
    }
  ]
}

accordionItem

One collapsible section inside an accordion.

Only valid directly inside accordion.

Holds other elements in children.

PropertyTypeRequiredDefaultWhat it does
titletextyesSection heading.
openbooleanOpen at first.

scroll

A fixed-height area that scrolls its content.

Holds other elements in children.

PropertyTypeRequiredDefaultWhat it does
heightnumber240Height in pixels.
{
  "type": "scroll",
  "height": 240,
  "children": []
}

separator

A dividing line.

Does not take children.

PropertyTypeRequiredDefaultWhat it does
labeltextOptional text centered on the line.
{
  "type": "separator"
}

spacer

Empty space. In a row it pushes siblings apart.

Does not take children.

PropertyTypeRequiredDefaultWhat it does
size"none" "xs" "sm" "md" "lg" "xl"Fixed size. Leave empty to fill the free space.
{
  "type": "spacer"
}

On this page