Skip to main content

Box Types Reference

All available box types and their attributes:

ClassType stringDescription
Habarico::Box'simple'Basic labeled container for fields
Habarico::GridBox'grid'12-column responsive grid container
Habarico::GridItemBox'grid-item'Grid column; accepts xs, sm, md, lg, xl breakpoints
Habarico::TabBox'tab'Tabbed container; children must be TabItemBox
Habarico::WizardBox'wizard'Step-by-step container; children must be TabItemBox (each is a step)
Habarico::TabItemBox'tab-item'Individual tab / wizard step pane
Habarico::ListBox'list'Embedded list of related records
Habarico::ArrayBox'array'Inline editor for array / has-many data
Habarico::ObjectBox'object'Inline display of a nested object
Habarico::GalleryBox'gallery'Image gallery from a related resource

Common attributes (on all box types via the base Box class):

AttributeDescription
labelSection heading text
nameBox name (used for ListBox referencing)
boxesChild boxes or field symbols
read_onlyMark all fields in this box as read-only
cardRender the box as a card component. Three states: true always, false never (even with a label, whose text then becomes a plain section heading), and omitted - the frontend decides from the label, the toolbar actions, the collapsible flag and the surface (the view's first box takes the card on a page, not in a dialog or side panel; a first box that only wraps other boxes - GridBox, TabBox, WizardBox, a Box without fields - hands that default to its children, so the card lands on the first box holding fields)
collapsibleMake the box collapsible; 'open' (expanded) or 'closed' (collapsed) sets the default state. Omit for a non-collapsible box
show_queryCondition expression to conditionally show the entire box
required_queryCondition expression to conditionally require the box
toolbar_actionsActions rendered in the box's local toolbar (box header / card header area), relative to the box root. On a tab/wizard container they appear on the last step. On a ListBox this is the box-level toolbar; use list_toolbar_actions for the table's own toolbar
bottom_actionsActions rendered at the bottom of the box, below the fields - similar to form submit buttons at the view level

GridItemBox-specific: xs, sm, md, lg, xl (MUI grid column widths, integer 1–12)

TabBox-specific: show_toolbar_navigation (show previous/next buttons in the box toolbar; default false)

WizardBox-specific: show_toolbar_navigation (show previous/next buttons; default true), validate_steps (validate the current step before moving to the next one; default true)

ListBox-specific (all attributes):

AttributeDescription
referenceResource name of the embedded list
targetForeign key name linking the list to the parent
extra_filtersLambda (c) -> Hash for additional filters
row_actionsActions available per row
toolbar_actionsBox-level actions rendered at the box root (box / card header), like on any other box
list_toolbar_actionsActions in the table's own toolbar (top of the resource list, e.g. create); emitted as toolbar_actions inside the list params
list_actionsUtility actions (export, print, …) rendered next to the filter bar, separate from row and toolbar actions
filtersFilter references for the embedded list
default_sortingDefault sort expression
sortable_field_nameField name used for drag-and-drop row sorting
sortable_sort_for_filtersFilter applied when saving sorted order
single_click_actionAction triggered by a single click on a row
double_click_actionAction triggered by a double click on a row
schema_paramsExtra query params sent when the box fetches the referenced resource's schema

GalleryBox-specific: reference, target, image_field, extra_filters, schema_params (use the common toolbar_actions attribute above to add manage/upload buttons)

ArrayBox-specific: target (attribute name on the parent holding the array), inline (render items inline like table rows; defaults to true unless the box contains nested boxes)

ObjectBox-specific: target (attribute name on the parent holding the nested object)